On x86 compilers without fastcall, simulate it when invoking traces and un-simulate...
[wine-gecko.git] / js / tests / pattern-expander.pl
blob3e99d547533d3ac8e002944b610098430a37eab3
1 #!/usr/bin/perl -w
2 # -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*-
3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/
11 # Software distributed under the License is distributed on an "AS IS" basis,
12 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 # for the specific language governing rights and limitations under the
14 # License.
16 # The Original Code is Mozilla JavaScript Testing Utilities
18 # The Initial Developer of the Original Code is
19 # Mozilla Corporation.
20 # Portions created by the Initial Developer are Copyright (C) 2008
21 # the Initial Developer. All Rights Reserved.
23 # Contributor(s): Bob Clary <bclary@bclary.com>
25 # Alternatively, the contents of this file may be used under the terms of
26 # either the GNU General Public License Version 2 or later (the "GPL"), or
27 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 # in which case the provisions of the GPL or the LGPL are applicable instead
29 # of those above. If you wish to allow use of your version of this file only
30 # under the terms of either the GPL or the LGPL, and not to allow others to
31 # use your version of this file under the terms of the MPL, indicate your
32 # decision by deleting the provisions above and replace them with the notice
33 # and other provisions required by the GPL or the LGPL. If you do not delete
34 # the provisions above, a recipient may use your version of this file under
35 # the terms of any one of the MPL, the GPL or the LGPL.
37 # ***** END LICENSE BLOCK *****
39 # usage: pattern-expander.pl knownfailures > knownfailures.expanded
41 # pattern-expander.pl reads the specified knownfailures file and
42 # writes to stdout an expanded set of failures where the wildcards
43 # ".*" are replaced with the set of possible values specified in the
44 # universe.data file.
46 use lib $ENV{TEST_DIR} . "/tests/mozilla.org/js";
48 use Patterns;
50 package Patterns;
52 processfile();
54 sub processfile
56 my ($i, $j);
58 while (<ARGV>) {
60 chomp;
62 $record = {};
64 my ($test_id, $test_branch, $test_repo, $test_buildtype, $test_type, $test_os, $test_kernel, $test_processortype, $test_memory, $test_cpuspeed, $test_timezone, $test_result, $test_exitstatus, $test_description) = $_ =~
65 /TEST_ID=([^,]*), TEST_BRANCH=([^,]*), TEST_REPO=([^,]*), TEST_BUILDTYPE=([^,]*), TEST_TYPE=([^,]*), TEST_OS=([^,]*), TEST_KERNEL=([^,]*), TEST_PROCESSORTYPE=([^,]*), TEST_MEMORY=([^,]*), TEST_CPUSPEED=([^,]*), TEST_TIMEZONE=([^,]*), TEST_RESULT=([^,]*), TEST_EXITSTATUS=([^,]*), TEST_DESCRIPTION=(.*)/;
67 $record->{TEST_ID} = $test_id;
68 $record->{TEST_BRANCH} = $test_branch;
69 $record->{TEST_REPO} = $test_repo;
70 $record->{TEST_BUILDTYPE} = $test_buildtype;
71 $record->{TEST_TYPE} = $test_type;
72 $record->{TEST_OS} = $test_os;
73 $record->{TEST_KERNEL} = $test_kernel;
74 $record->{TEST_PROCESSORTYPE} = $test_processortype;
75 $record->{TEST_MEMORY} = $test_memory;
76 $record->{TEST_CPUSPEED} = $test_cpuspeed;
77 $record->{TEST_TIMEZONE} = $test_timezone;
78 $record->{TEST_RESULT} = $test_result;
79 $record->{TEST_EXITSTATUS} = $test_exitstatus;
80 $record->{TEST_DESCRIPTION} = $test_description;
82 dbg("processfile: \$_=$_");
84 my @list1 = ();
85 my @list2 = ();
87 my $iuniversefield;
88 my $universefield;
90 $item1 = copyreference($record);
91 dbg("processfile: check copyreference");
92 dbg("processfile: \$record=" . recordtostring($record));
93 dbg("processfile: \$item1=" . recordtostring($item1));
95 push @list1, ($item1);
97 for ($iuniversefield = 0; $iuniversefield < @universefields; $iuniversefield++)
99 $universefield = $universefields[$iuniversefield];
101 dbg("processfile: \$universefields[$iuniversefield]=$universefield, \$record->{$universefield}=$record->{$universefield}");
103 for ($j = 0; $j < @list1; $j++)
105 $item1 = $list1[$j];
106 dbg("processfile: item1 \$list1[$j]=" . recordtostring($item1));
107 # create a reference to a copy of the hash referenced by $item1
108 if ($item1->{$universefield} ne '.*')
110 dbg("processfile: literal value");
111 $item2 = copyreference($item1);
112 dbg("processfile: check copyreference");
113 dbg("processfile: \$item1=" . recordtostring($item1));
114 dbg("processfile: \$item2=" . recordtostring($item2));
115 dbg("processfile: pushing existing record to list 2: " . recordtostring($item2));
116 push @list2, ($item2);
118 else
120 dbg("processfile: wildcard value");
121 $keyfielduniversekey = getuniversekey($item1, $universefield);
122 @keyfielduniverse = getuniverse($keyfielduniversekey, $universefield);
124 dbg("processfile: \$keyfielduniversekey=$keyfielduniversekey, \@keyfielduniverse=" . join(',', @keyfielduniverse));
126 for ($i = 0; $i < @keyfielduniverse; $i++)
128 $item2 = copyreference($item1);
129 dbg("processfile: check copyreference");
130 dbg("processfile: \$item1=" . recordtostring($item1));
131 dbg("processfile: \$item2=" . recordtostring($item2));
132 $item2->{$universefield} = $keyfielduniverse[$i];
133 dbg("processfile: pushing new record to list 2 " . recordtostring($item2));
134 push @list2, ($item2);
137 for ($i = 0; $i < @list1; $i++)
139 dbg("processfile: \$list1[$i]=" . recordtostring($list1[$i]));
141 for ($i = 0; $i < @list2; $i++)
143 dbg("processfile: \$list2[$i]=" . recordtostring($list2[$i]));
147 @list1 = @list2;
148 @list2 = ();
150 for ($j = 0; $j < @list1; $j++)
152 $item1 = $list1[$j];
153 push @records, ($item1);
156 @records = sort sortrecords @records;
158 dumprecords();