diff --git a/mozilla/js/tests/Patterns.pm b/mozilla/js/tests/Patterns.pm index 2ca29d4dfbf..e6e7de5d260 100644 --- a/mozilla/js/tests/Patterns.pm +++ b/mozilla/js/tests/Patterns.pm @@ -43,11 +43,15 @@ sub getuniversekey my $i; my $key = ''; - dbg("getuniversekey: \$machinerecord=" . recordtostring($machinerecord) . ", \$excludeduniversefield=$excludeduniversefield"); + if ($DEBUG) { + dbg("getuniversekey: \$machinerecord=" . recordtostring($machinerecord) . ", \$excludeduniversefield=$excludeduniversefield"); + } for ($i = 0; $i < @universefields; $i++) { - dbg("getuniversekey: \$universefields[$i]=$universefields[$i]"); + if ($DEBUG) { + dbg("getuniversekey: \$universefields[$i]=$universefields[$i]"); + } if ($universefields[$i] ne $excludeduniversefield) { @@ -55,7 +59,9 @@ sub getuniversekey } } - dbg("getuniversekey=$key"); + if ($DEBUG) { + dbg("getuniversekey=$key"); + } return $key; } @@ -69,31 +75,45 @@ sub getuniverse my @universe = (); my %universehash = (); - dbg("getuniverse: \$universekey=$universekey, \$excludeduniversefield=$excludeduniversefield"); + if ($DEBUG) { + dbg("getuniverse: \$universekey=$universekey, \$excludeduniversefield=$excludeduniversefield"); + } for ($i = 0; $i < @testruns; $i++) { $testrun = $testruns[$i]; - dbg("getuniverse: \$testruns[$i]=" . recordtostring($testrun)); + if ($DEBUG) { + dbg("getuniverse: \$testruns[$i]=" . recordtostring($testrun)); + } $testrununiversekey = getuniversekey($testrun, $excludeduniversefield); - dbg("getuniverse: \$testrununiversekey=$testrununiversekey"); + if ($DEBUG) { + dbg("getuniverse: \$testrununiversekey=$testrununiversekey"); + } if ($testrununiversekey =~ /$universekey/) { - dbg("getuniverse: matched \$testrununiversekey=$testrununiversekey to \$universekey=$universekey"); + if ($DEBUG) { + dbg("getuniverse: matched \$testrununiversekey=$testrununiversekey to \$universekey=$universekey"); + } $value = $testrun->{$excludeduniversefield}; - dbg("getuniverse: \$testrun->{$excludeduniversefield}=$value"); + if ($DEBUG) { + dbg("getuniverse: \$testrun->{$excludeduniversefield}=$value"); + } if (! $universehash{$value} ) { - dbg("getuniverse: pushing $value"); + if ($DEBUG) { + dbg("getuniverse: pushing $value"); + } push @universe, ($value); $universehash{$value} = 1; } } } @universe = sort @universe; - dbg("getuniverse=" . join(',', @universe)); + if ($DEBUG) { + dbg("getuniverse=" . join(',', @universe)); + } return @universe; } @@ -107,11 +127,15 @@ sub recordtostring for ($j = 0; $j < @recordfields - 1; $j++) { $field = $recordfields[$j]; - dbg("recordtostring: \$field=$field, \$record->{$field}=$record->{$field}"); + if ($DEBUG) { + dbg("recordtostring: \$field=$field, \$record->{$field}=$record->{$field}"); + } $line .= "$field=$record->{$field}, "; } $field = $recordfields[$#recordfields]; - dbg("recordtodtring: \$field=$field, \$record->{$field}= $record->{$field}"); + if ($DEBUG) { + dbg("recordtodtring: \$field=$field, \$record->{$field}= $record->{$field}"); + } $line .= "$field=$record->{$field}"; return $line; @@ -124,7 +148,9 @@ sub dumprecords my $prevline = ''; my $i; - dbg("dumping records"); + if ($DEBUG) { + dbg("dumping records"); + } # @records = sort sortrecords @records; @@ -178,9 +204,9 @@ BEGIN $DEBUG = $ENV{DEBUG}; - @recordfields = ('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'); - @sortkeyfields = ('TEST_ID', 'TEST_RESULT', 'TEST_EXITSTATUS', 'TEST_DESCRIPTION', 'TEST_BRANCH', 'TEST_REPO', 'TEST_BUILDTYPE', 'TEST_TYPE', 'TEST_OS', 'TEST_KERNEL', 'TEST_PROCESSORTYPE', 'TEST_MEMORY', 'TEST_CPUSPEED', 'TEST_TIMEZONE', ); - @universefields = ('TEST_BRANCH', 'TEST_REPO', 'TEST_BUILDTYPE', 'TEST_TYPE', 'TEST_OS', 'TEST_KERNEL', 'TEST_PROCESSORTYPE', 'TEST_MEMORY', 'TEST_CPUSPEED', 'TEST_TIMEZONE'); + @recordfields = ('TEST_ID', 'TEST_BRANCH', 'TEST_REPO', 'TEST_BUILDTYPE', 'TEST_TYPE', 'TEST_OS', 'TEST_KERNEL', 'TEST_PROCESSORTYPE', 'TEST_MEMORY', 'TEST_CPUSPEED', 'TEST_TIMEZONE', 'TEST_OPTIONS', 'TEST_RESULT', 'TEST_EXITSTATUS', 'TEST_DESCRIPTION'); + @sortkeyfields = ('TEST_ID', 'TEST_RESULT', 'TEST_EXITSTATUS', 'TEST_DESCRIPTION', 'TEST_BRANCH', 'TEST_REPO', 'TEST_BUILDTYPE', 'TEST_TYPE', 'TEST_OS', 'TEST_KERNEL', 'TEST_PROCESSORTYPE', 'TEST_MEMORY', 'TEST_CPUSPEED', 'TEST_TIMEZONE', 'TEST_OPTIONS'); + @universefields = ('TEST_BRANCH', 'TEST_REPO', 'TEST_BUILDTYPE', 'TEST_TYPE', 'TEST_OS', 'TEST_KERNEL', 'TEST_PROCESSORTYPE', 'TEST_MEMORY', 'TEST_CPUSPEED', 'TEST_TIMEZONE', 'TEST_OPTIONS'); @records = (); @@ -200,8 +226,8 @@ BEGIN my $record = {}; - my ($test_os, $test_kernel, $test_processortype, $test_memory, $test_cpuspeed, $test_timezone, $test_branch, $test_repo, $test_buildtype, $test_type) = $_ =~ - /^TEST_OS=([^,]*), TEST_KERNEL=([^,]*), TEST_PROCESSORTYPE=([^,]*), TEST_MEMORY=([^,]*), TEST_CPUSPEED=([^,]*), TEST_TIMEZONE=([^,]*), TEST_BRANCH=([^,]*), TEST_REPO=([^,]*), TEST_BUILDTYPE=([^,]*), TEST_TYPE=([^,]*)/; + my ($test_os, $test_kernel, $test_processortype, $test_memory, $test_cpuspeed, $test_timezone, $test_jsoptions, $test_branch, $test_repo, $test_buildtype, $test_type) = $_ =~ + /^TEST_OS=([^,]*), TEST_KERNEL=([^,]*), TEST_PROCESSORTYPE=([^,]*), TEST_MEMORY=([^,]*), TEST_CPUSPEED=([^,]*), TEST_TIMEZONE=([^,]*), TEST_OPTIONS=([^,]*), TEST_BRANCH=([^,]*), TEST_REPO=([^,]*), TEST_BUILDTYPE=([^,]*), TEST_TYPE=([^,]*)/; $record->{TEST_ID} = 'dummy'; $record->{TEST_RESULT} = 'dummy'; @@ -218,6 +244,7 @@ BEGIN $record->{TEST_MEMORY} = $test_memory; $record->{TEST_CPUSPEED} = $test_cpuspeed; $record->{TEST_TIMEZONE} = $test_timezone; + $record->{TEST_OPTIONS} = $test_jsoptions; dbg("BEGIN: testrun: " . recordtostring($record)); diff --git a/mozilla/js/tests/bisect.sh b/mozilla/js/tests/bisect.sh index fdabcde6ea1..09d372fccc5 100755 --- a/mozilla/js/tests/bisect.sh +++ b/mozilla/js/tests/bisect.sh @@ -76,7 +76,7 @@ usage: bisect.sh -p product -b branch -e extra\\ variable description =============== ============================================================ -p bisect_product one of js, firefox - -b bisect_branches one of branches 1.8.0, 1.8.1, 1.9.0, 1.9.1 + -b bisect_branches one of branches 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.9.2 -e bisect_extra optional. extra qualifier to pick build tree and mozconfig. -T bisect_buildtype one of build types opt debug -t bisect_test Test to be bisected. @@ -88,9 +88,9 @@ usage: bisect.sh -p product -b branch -e extra\\ bisect_string can contain any extended regular expressions supported by egrep. -G bisect_good For branches 1.8.0, 1.8.1, 1.9.0, date test passed - For branch 1.9.1, revision test passed + For branch 1.9.1 and later, revision test passed -B bisect_bad For branches, 1.8.0, 1.8.1, 1.9.0 date test failed - For branch 1.9.1, revision test failed. + For branch 1.9.1 and later, revision test failed. If the good revision (test passed) occurred prior to the bad revision (test failed), the script will search for the first bad revision which @@ -267,7 +267,7 @@ EOF while true; do if (( $seconds_index_start+1 >= $seconds_index_stop )); then - echo "*** date `date -r ${seconds_array[$seconds_index_stop]}` found ***" + echo "*** date `perl -e 'print scalar localtime $ARGV[0];' ${seconds_array[$seconds_index_stop]}` found ***" break; fi @@ -279,7 +279,7 @@ EOF let seconds_index_middle="($seconds_index_start + $seconds_index_stop)/2" let seconds_middle="${seconds_array[$seconds_index_middle]}" - bisect_middle="`date -r $seconds_middle`" + bisect_middle="`perl -e 'print scalar localtime $ARGV[0];' $seconds_middle`" export MOZ_CO_DATE="$bisect_middle" echo "testing $MOZ_CO_DATE" @@ -314,7 +314,7 @@ EOF done ;; - 1.9.1) + 1.9.1|1.9.2) # # binary search using mercurial # diff --git a/mozilla/js/tests/browser.js b/mozilla/js/tests/browser.js index b349fbe2f7e..1b7a8c19eca 100755 --- a/mozilla/js/tests/browser.js +++ b/mozilla/js/tests/browser.js @@ -610,106 +610,84 @@ function jsTestDriverBrowserInit() return; } - var re = /test=([^;]+);language=(language|type);([a-zA-Z0-9.=;\/]+)/; - var matches = re.exec(document.location.search); - - // testpath http://machine/path-to-suite/sub-suite/test.js - var testpath = matches[1]; - var attribute = matches[2]; - var value = matches[3]; - - if (testpath) + var properties = {}; + var fields = document.location.search.slice(1).split(';'); + for (var ifield = 0; ifield < fields.length; ifield++) { - testpath = decodeURIComponent(testpath); - gTestPath = testpath; + var propertycaptures = /^([^=]+)=(.*)$/.exec(fields[ifield]); + if (!propertycaptures) + { + properties[fields[ifield]] = true; + } + else + { + properties[propertycaptures[1]] = decodeURIComponent(propertycaptures[2]); + if (propertycaptures[1] == 'language') + { + // language=(type|language);mimetype + properties.mimetype = fields[ifield+1]; + } + } } - var ise4x = /e4x\//.test(testpath); - - var gczealmatches = /gczeal=([0-9]*)/.exec(document.location.search); - - if (gczealmatches) + if (properties.language != 'type') { - var zeal = Number(gczealmatches[1]); - gczeal(zeal); + try + { + properties.version = /javascript([.0-9]+)/.exec(properties.mimetype)[1]; + } + catch(ex) + { + } } -/* - * since the default setting of jit changed from false to true - * in http://hg.mozilla.org/tracemonkey/rev/685e00e68be9 - * bisections which depend upon jit settings can be thrown off. - * default jit(false) to make bisections depending upon jit settings - * consistent over time. This is not needed in shell tests as the default - * jit setting has not changed there. - */ - - var jitmatches = /;jit/.exec(document.location.search); - - if (jitmatches) - { - jit(true); - } - else - { - jit(false); - } - - var versionmatches; - - if (attribute == 'type') - { - versionmatches = /version=([.0-9]+)/.exec(value); - } - else - { - versionmatches = /javascript([.0-9]+)/.exec(value); - } - - if (versionmatches) - { - gVersion = 10*parseInt(versionmatches[1].replace(/\./g, '')); - } - else if (navigator.userAgent.indexOf('Gecko/') != -1) + if (!properties.version && navigator.userAgent.indexOf('Gecko/') != -1) { // If the version is not specified, and the browser is Gecko, // adjust the version to match the suite version. - if (attribute == 'type') + if (properties.test.match(/^js1_6/)) { - value = 'text/javascript;version='; + properties.version = '1.6'; + } + else if (properties.test.match(/^js1_7/)) + { + properties.version = '1.7'; + } + else if (properties.test.match(/^js1_8/)) + { + properties.version = '1.8'; + } + else if (properties.test.match(/^js1_8_1/)) + { + properties.version = '1.8'; } else { - value = 'javascript'; - } - - if (testpath.match(/^js1_6/)) - { - gVersion = 160; - value += '1.6'; - } - else if (testpath.match(/^js1_7/)) - { - gVersion = 170; - value += '1.7'; - } - else if (testpath.match(/^js1_8/)) - { - gVersion = 180; - value += '1.8'; - } - else if (testpath.match(/^js1_8_1/)) - { - gVersion = 180; - value += '1.8'; - } - else - { - gVersion = 150; - value += '1.5'; + properties.version = '1.5'; } } - var testpathparts = testpath.split(/\//); + gTestPath = properties.test; + + gVersion = 10*parseInt(properties.version.replace(/\./g, '')); + + if (properties.gczeal) + { + gczeal(Number(properties.gczeal)); + } + + /* + * since the default setting of jit changed from false to true + * in http://hg.mozilla.org/tracemonkey/rev/685e00e68be9 + * bisections which depend upon jit settings can be thrown off. + * default jit(false) to make bisections depending upon jit settings + * consistent over time. This is not needed in shell tests as the default + * jit setting has not changed there. + */ + + jit(properties.jit); + + var testpathparts = properties.test.split(/\//); if (testpathparts.length < 3) { @@ -720,52 +698,55 @@ function jsTestDriverBrowserInit() var subsuite = testpathparts[testpathparts.length - 2]; var test = testpathparts[testpathparts.length - 1]; - outputscripttag(suitepath + '/shell.js', attribute, value, - ise4x); - outputscripttag(suitepath + '/browser.js', attribute, value, - ise4x); - outputscripttag(suitepath + '/' + subsuite + '/shell.js', attribute, value, - ise4x); - outputscripttag(suitepath + '/' + subsuite + '/browser.js', attribute, value, - ise4x); - outputscripttag(suitepath + '/' + subsuite + '/' + test, attribute, value, - ise4x); + outputscripttag(suitepath + '/shell.js', properties); + outputscripttag(suitepath + '/browser.js', properties); + outputscripttag(suitepath + '/' + subsuite + '/shell.js', properties); + outputscripttag(suitepath + '/' + subsuite + '/browser.js', properties); + outputscripttag(suitepath + '/' + subsuite + '/' + test, properties, + properties.e4x || /e4x\//.test(properties.test)); - document.write('