JavaScript Tests - run Tinderbox browser tests without restarting browser, bug 406196

This commit is contained in:
bclary%bclary.com 2008-02-06 20:06:40 +00:00
Родитель f55a82ad81
Коммит 0749ff9272
29 изменённых файлов: 1407 добавлений и 537 удалений

Просмотреть файл

@ -1,52 +1,37 @@
# -*- Makefile -*-
TEST_HTTP ?= test.mozilla.com
TEST_JS = $(shell find . -name '*.js' -print)
CURRDIR=$(shell pwd)
JSDIR=$(shell basename $(CURRDIR))
all: menu.html 1.8.0-list.txt 1.8.1-list.txt 1.9.0-list.txt menu-list.txt excluded-n.tests spidermonkey-extensions-n.tests failures.txt
all: menu.html \
menu-list.txt \
spidermonkey-extensions-n.tests \
failures.txt
menu.html: menuhead.html menufoot.html Makefile excluded-n.tests $(TEST_JS)
menu.html: menuhead.html menufoot.html Makefile spidermonkey-n.tests $(TEST_JS)
perl mklistpage.pl > menubody.html
cat menuhead.html menubody.html menufoot.html > menu.html
excluded-n.tests: spidermonkey-n.tests slow-n.tests performance.tests
cat $^ > $@
spidermonkey-extensions-n.tests: $(TEST_JS)
find . -name '*.js' | grep -v shell.js | grep -v browser.js | grep '/extensions/' | sed 's|\.\/||' | sort > $@
menu-list.txt:
echo "http://$(TEST_HTTP)/tests/mozilla.org/$(JSDIR)/menu.html" > menu-list.txt
1.8.0-list.txt: $(TEST_JS) excluded-n.tests
./list.sh e4x ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6 | sort > 1.8.0-list.txt
1.8.1-list.txt: $(TEST_JS) 1.8.0-list.txt excluded-n.tests
cat 1.8.0-list.txt > 1.8.1-list.txt
./list.sh js1_7 | sort >> 1.8.1-list.txt
1.9.0-list.txt: $(TEST_JS) 1.8.1-list.txt excluded-n.tests
cat 1.8.1-list.txt > 1.9.0-list.txt
./list.sh js1_8 | sort >> 1.9.0-list.txt
confidential-failures.txt:
touch confidential-failures.txt
failures.txt: public-failures.txt confidential-failures.txt
cp public-failures.txt public-failures.txt.save
cp confidential-failures.txt confidential-failures.txt.save
sort < public-failures.txt | uniq | ./create-patterns.pl > public-failures.$$
mv public-failures.$$ public-failures.txt
sort < confidential-failures.txt | uniq | ./create-patterns.pl > confidential-failures.$$
mv confidential-failures.$$ confidential-failures.txt
cat public-failures.txt confidential-failures.txt | sort | uniq > failures.txt
ecma_3/RegExp/re_tests:
curl -LsS -m 1800 "http://www.cpan.org/src/stable.tar.bz2" -o stable.tar.bz2
tar -jxvf stable.tar.bz2
cp `find . -maxdepth 1 -name 'perl-*'`/t/op/re_tests ecma_3/RegExp/re_tests
rm -fR `find . -maxdepth 1 -name 'perl-*'` stable.tar.bz2
clean:
rm -f menubody.html menu.html *-list.txt excluded-n.tests failures.txt
rm -f menubody.html menu.html menu-list.txt failures.txt excluded-*.tests included-*.tests urllist*.html urllist*.tests

Просмотреть файл

@ -134,16 +134,7 @@ window.onerror = function (msg, page, line)
testcase.passed = true;
}
testcase.reason += msg;
if (typeof(page) != 'undefined')
{
testcase.reason += ' Page: ' + page;
}
if (typeof(line) != 'undefined')
{
testcase.reason += ' Line: ' + line;
}
testcase.reason = page + ':' + line + ': ' + msg;
reportFailure(msg);

Просмотреть файл

@ -45,23 +45,29 @@ var expect = 'No Crash';
printBugNumber(BUGNUMBER);
START(summary);
printStatus ("Expect out of memory error");
printStatus ("Expect out of memory or script stack space quota is exhausted error");
expectExitCode(3);
var i,m,str;
str="<a xmlns:v=\"";
m="";
try
{
var i,m,str;
str="<a xmlns:v=\"";
m="";
for (i=0;i<(1024*1024)/2;i++)
m += "\n";
for (i=0;i<(1024*1024)/2;i++)
m += "\n";
for(i=0;i<500;i++)
str += m ;
for(i=0;i<500;i++)
str += m ;
str += "\">f00k</a>";
str += "\">f00k</a>";
var xx = new XML(str);
var xx = new XML(str);
printStatus(xx.toXMLString());
printStatus(xx.toXMLString());
}
catch(ex)
{
print(ex + '');
}
TEST(1, expect, actual);

Просмотреть файл

@ -46,9 +46,14 @@ var expect = 'No Crash';
printBugNumber(BUGNUMBER);
START(summary);
if (typeof document != 'undefined')
if (typeof document != 'undefined' && 'addEventListener' in document)
{
document.location.href='javascript:<x/>.@*++;';
document.addEventListener('load',
(function () {
var iframe = document.createElement('iframe');
document.body.appendChild('iframe');
iframe.contentDocument.location.href='javascript:<x/>.@*++;';
}), true);
}
else
{

Просмотреть файл

@ -45,21 +45,28 @@ var expect = 'No Crash';
printBugNumber(BUGNUMBER);
START(summary);
printStatus ("Expect out of memory or script stack space quota is exhausted error");
expectExitCode(0);
expectExitCode(3);
var str = '0123456789';
for (var icount = 0; icount < 24; icount++)
try
{
str = str + str;
var str = '0123456789';
for (var icount = 0; icount < 24; icount++)
{
str = str + str;
}
printStatus(str.length);
var x = new XML('<root>' + str + '</root>');
}
catch(ex)
{
print(ex + '');
}
printStatus(str.length);
var x = new XML('<root>' + str + '</root>');
TEST(1, expect, actual);
END();

Просмотреть файл

@ -67,16 +67,9 @@ window.onerror = function (msg, page, line)
' Section ' + SECTION, EXPECTED, "error");
testcase.passed = false;
testcase.reason += msg;
if (typeof(page) != 'undefined')
{
testcase.reason += ' Page: ' + page;
}
if (typeof(line) != 'undefined')
{
testcase.reason += ' Line: ' + line;
}
testcase.reason = page + ':' + line + ': ' + msg;
reportFailure(SECTION, msg);
gDelayTestDriverEnd = false;

Просмотреть файл

@ -1,7 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Import Test List</title>
<script language="JavaScript" src="importList.js"></script>
</head>
@ -9,17 +7,16 @@
<form name="foo">
<textarea rows="25" cols="50" name="testList"></textarea><br>
<input type="checkbox" name="clear_all" checked>
&nbsp;Clear all selections before import.<br>
<script language="javascript">
if (include)
{
document.write('<input type="checkbox" name="clear_all" checked>');
document.write('&nbsp;Clear all selections before import.<br>');
}
</script>
<input type="button" value="Import" onclick="doImport();">
<input type="button" value="Cancel" onclick="window.close();">
</form>
<hr>
<address><a href="mailto:rginda@netscape.com"></a></address>
<!-- Created: Wed Nov 17 13:52:23 PST 1999 -->
<!-- hhmts start -->
Last modified: Wed Nov 17 14:18:42 PST 1999
<!-- hhmts end -->
</body>
</html>

Просмотреть файл

@ -35,6 +35,9 @@
*
* ***** END LICENSE BLOCK ***** */
var include = document.location.href.indexOf('?include') != -1;
document.write( '<title>Import ' + (include ? 'Include' : 'Exclude') + ' Test List<\/title>')
function doImport()
{
var lines =
@ -42,7 +45,7 @@ function doImport()
var suites = window.opener.suites;
var elems = window.opener.document.forms["testCases"].elements;
if (document.forms["foo"].elements["clear_all"].checked)
if (include && document.forms["foo"].elements["clear_all"].checked)
window.opener._selectNone();
for (var l in lines)
@ -72,11 +75,16 @@ function doImport()
{
var radioname = suites[ary[1]].testDirs[ary[2]].tests[ary[3]].id;
var radio = elems[radioname];
if (!radio.checked)
if (include && !radio.checked)
{
radio.checked = true;
window.opener.onRadioClick(radio);
}
else if (!include && radio.checked)
{
radio.checked = false;
window.opener.onRadioClick(radio);
}
}
}
}

Просмотреть файл

@ -44,14 +44,20 @@ var expect = 'No Crash';
printBugNumber(BUGNUMBER);
printStatus (summary);
expectExitCode(3)
expectExitCode(3);
var a = new Array();
var a = new Array();
while (1)
try
{
(a = new Array(a)).sort();
while (1)
{
(a = new Array(a)).sort();
}
}
catch(ex)
{
print(ex + '');
}
reportCompare(expect, actual, summary);

Просмотреть файл

@ -65,7 +65,7 @@ function test()
{
actual = ex.name;
}
reportCompare(expect, actual, summary);
reportCompare(expect, actual, summary + ": }");
try
{
@ -77,7 +77,7 @@ function test()
{
actual = ex.name;
}
reportCompare(expect, actual, summary);
reportCompare(expect, actual, summary + ": }}}}}");
try
{
@ -89,7 +89,7 @@ function test()
{
actual = ex.name;
}
reportCompare(expect, actual, summary);
reportCompare(expect, actual, summary + ": alert(6); } alert(5);");
try
{
@ -101,7 +101,7 @@ function test()
{
actual = ex.name;
}
reportCompare(expect, actual, summary);
reportCompare(expect, actual, summary + ": } {");
exitFunc ('test');
}

Просмотреть файл

@ -79,7 +79,8 @@ function test()
}
print('done');
reportCompare(expect, actual, summary);
setTimeout('checkTest()', 10000);
exitFunc ('test');
}
@ -87,12 +88,25 @@ function test()
function init()
{
// give the dialog closer time to register
setTimeout('runtest()', 5000);
setTimeout('test()', 5000);
}
function runtest()
var lastialert = 0;
function checkTest()
{
test();
// this function is used to check if there
// additional alerts are still being fired
// in order to prevent the test from completing
// until all alerts have finished.
if (ialert != lastialert)
{
lastialert = ialert;
setTimeout('checkTest()', 10000);
return;
}
reportCompare(expect, actual, summary);
gDelayTestDriverEnd = false;
jsTestDriverEnd();

Просмотреть файл

@ -51,6 +51,7 @@ sub unescape_pattern;
my $option_desc = "b=s branch>b T=s buildtype>T t=s testtype>t l=s rawlogfile>l f=s failurelogfile>f o=s os>o r=s patterns>r z=s timezone>z O=s outputprefix>O A=s arch>A K=s kernel>K D debug>D";
my $testid;
my $branch;
my $buildtype;
my $testtype;
@ -87,12 +88,13 @@ my @failures;
my @fixes;
my @excludedtests;
my $excludedtest;
my $excludedfile;
my %includedtests = {};
my $includedfile;
my @results;
my $regchars = '\[\^\-\]\|\{\}\?\*\+\.\<\>\$\(\)';
my @excludedfiles = ('spidermonkey-n.tests', 'slow-n.tests', 'performance.tests');
my $excludedfile;
&parse_options;
@ -102,6 +104,9 @@ if (!defined($jsdir)) {
$jsdir = "/work/mozilla/mozilla.com/test.mozilla.com/www/tests/mozilla.org/js";
}
my @excludedfiles = ("excluded-$branch-$testtype-$buildtype.tests");
my @includedfiles = ("included-$branch-$testtype-$buildtype.tests");
# create working patterns file consisting of matches to users selection
# and which has the test description patterns escaped
@ -124,6 +129,20 @@ foreach $excludedfile ( @excludedfiles ) {
@excludedtests = sort @excludedtests;
foreach $includedfile ( @includedfiles ) {
open INCLUDED, "<$jsdir/$includedfile" or die "Unable to open included file $jsdir/$includedfile: $!\n";
while (<INCLUDED>) {
chomp;
next if ($_ =~ /^\#/);
s/\s+$//;
$includedtests{$_} = 1;
}
close INCLUDED;
}
debug "loading patterns $patterns";
debug "pattern filter: /^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_RESULT=[^,]*, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_MACHINE=[^,]*, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_DATE=[^,]*, TEST_TIMEZONE=$knownfailuretimezonepattern,/\n";
@ -133,7 +152,13 @@ while (<PATTERNS>) {
s/\s+$//;
if ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_RESULT=[^,]*, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_MACHINE=[^,]*, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_DATE=[^,]*, TEST_TIMEZONE=$knownfailuretimezonepattern,/) {
($testid) = $_ =~ /^TEST_ID=([^,]*),/;
if (!$includedtests{$testid})
{
debug "test $testid was not included during this run";
}
elsif ($_ =~ /^TEST_ID=[^,]*, TEST_BRANCH=$knownfailurebranchpattern, TEST_RESULT=[^,]*, TEST_BUILDTYPE=$knownfailurebuildtypepattern, TEST_TYPE=$knownfailuretesttypepattern, TEST_OS=$knownfailureospattern, TEST_MACHINE=[^,]*, TEST_PROCESSORTYPE=$knownfailurearchpattern, TEST_KERNEL=$knownfailurekernelpattern, TEST_DATE=[^,]*, TEST_TIMEZONE=$knownfailuretimezonepattern,/) {
debug "adding pattern: $_";
push @patterns, (escape_pattern($_));
}
@ -155,7 +180,7 @@ if (defined($rawlogfile)) {
debug "writing failures $failurelogfile";
open INPUTLOG, "$jsdir/post-process-logs.pl $rawlogfile|sort|uniq|" or die "Unable to open $rawlogfile $!\n";
open INPUTLOG, "$jsdir/post-process-logs.pl $rawlogfile |" or die "Unable to open $rawlogfile $!\n";
open ALLLOG, ">$alllog" or die "Unable to open $alllog $!\n";
open FAILURELOG, ">$failurelogfile" or die "Unable to open $failurelogfile $!\n";
@ -171,9 +196,12 @@ if (defined($rawlogfile)) {
}
}
close INPUTLOG;
my $inputrc = $?;
close ALLLOG;
close FAILURELOG;
die "FATAL ERROR in post-process-logs.pl" if $inputrc != 0;
}
else {
@ -208,6 +236,7 @@ foreach $pattern (@patterns) {
}
foreach $excludedtest ( @excludedtests ) {
# remove any potential fixes which are due to the test being excluded
if ($debug) {
@results = grep m@$excludedtest@, @fixes;
@ -302,7 +331,7 @@ print STDOUT "log: $outputprefix-results-possible-regressions.log\n";
sub debug {
if ($debug) {
my $msg = shift;
print "DEBUG: $msg\n";
print STDERR "DEBUG: $msg\n";
}
}
@ -322,7 +351,7 @@ known-failures.pl [-b|--branch] branch [-T|--buildtype] buildtype
variable description
=============== ============================================================
-b branch branch 1.8.1, 1.9.0, all
-b branch branch 1.8.0, 1.8.1, 1.9.0, all
-T buildtype build type opt, debug, all
-t testtype test type browser, shell, all
-l rawlogfile raw logfile
@ -426,6 +455,10 @@ sub parse_options {
usage "missing outputprefix";
}
if ($branch eq "1.8.0") {
$knownfailurebranchpattern = "([^,]*1\\.8\\.0[^,]*|\\.\\*)";
$failurebranchpattern = "1\\.8\\.0";
}
if ($branch eq "1.8.1") {
$knownfailurebranchpattern = "([^,]*1\\.8\\.1[^,]*|\\.\\*)";
$failurebranchpattern = "1\\.8\\.1";

Просмотреть файл

Просмотреть файл

@ -15,8 +15,10 @@
<form name="testCases" action="">
<input type='button' value='Export Test List' onClick='createList();'>
<input type='button' value='Import Test List'
onClick='window.open("importList.html", "other_window");'>
<input type='button' value='Include Test List'
onClick='window.open("importList.html?include", "include_window");'>
<input type='button' value='Exclude Test List'
onClick='window.open("importList.html?exclude", "exclude_window");'>
<h2>Browser Test Options</h2>
<p>

Просмотреть файл

@ -0,0 +1,15 @@
ecma_3/RegExp/regress-311414.js
ecma_3/RegExp/regress-289669.js
js1_5/extensions/regress-335700.js
js1_5/extensions/regress-347306-02.js
js1_5/String/regress-314890.js
js1_5/String/regress-56940-01.js
js1_5/String/regress-322772.js
js1_5/String/regress-157334-01.js
js1_5/String/regress-56940-02.js
js1_5/Regress/regress-347306-01.js
js1_5/Regress/regress-313967-02.js
js1_5/Regress/regress-169559.js
js1_5/Regress/regress-313967-01.js
js1_5/Array/regress-99120-01.js
js1_5/Array/regress-99120-02.js

Просмотреть файл

@ -0,0 +1,15 @@
ecma_3/RegExp/regress-311414.js
ecma_3/RegExp/regress-289669.js
js1_5/extensions/regress-335700.js
js1_5/extensions/regress-347306-02.js
js1_5/String/regress-314890.js
js1_5/String/regress-56940-01.js
js1_5/String/regress-322772.js
js1_5/String/regress-157334-01.js
js1_5/String/regress-56940-02.js
js1_5/Regress/regress-347306-01.js
js1_5/Regress/regress-313967-02.js
js1_5/Regress/regress-169559.js
js1_5/Regress/regress-313967-01.js
js1_5/Array/regress-99120-01.js
js1_5/Array/regress-99120-02.js

Просмотреть файл

@ -0,0 +1,15 @@
ecma_3/RegExp/regress-311414.js
ecma_3/RegExp/regress-289669.js
js1_5/extensions/regress-335700.js
js1_5/extensions/regress-347306-02.js
js1_5/String/regress-314890.js
js1_5/String/regress-56940-01.js
js1_5/String/regress-322772.js
js1_5/String/regress-157334-01.js
js1_5/String/regress-56940-02.js
js1_5/Regress/regress-347306-01.js
js1_5/Regress/regress-313967-02.js
js1_5/Regress/regress-169559.js
js1_5/Regress/regress-313967-01.js
js1_5/Array/regress-99120-01.js
js1_5/Array/regress-99120-02.js

Просмотреть файл

@ -1,6 +1,5 @@
#!/usr/bin/perl -w
# -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
@ -47,29 +46,32 @@ sub outputrecord;
local $file;
local $temp;
local $DEBUG = 0;
my $debug = $ENV{DEBUG};
(undef, $temp) = tempfile();
open TEMP, ">$temp" or
die "Unable to open temporary file $temp for writing: $!\n";
die "FATAL ERROR: Unable to open temporary file $temp for writing: $!\n";
local ($test_id, $test_bug, $test_result, $test_type,
$test_description, $in_browser_test, @messages,
$test_processortype, $test_kernel, $test_suite,
$last_test);
local ($test_id,
$test_result,
$test_type,
$tmp_test_type,
$test_description,
@messages,
$test_processortype,
$test_kernel,
$test_suite,
$exit_flag,
$page_flag,
$test_state);
local $count_begintests = 0;
local $count_jstests = 0;
local $count_exitonlytestsnormal = 0;
local $count_exitonlytestsabnormal = 0;
local ($actual_exit, $actual_signal);
local $count_records = 0;
local $count_jstests = 0;
while ($file = shift @ARGV)
{
dbg "initializing in_browser_test, messages";
$in_browser_test = 0;
@messages = ();
dbg "file: $file";
@ -79,8 +81,8 @@ while ($file = shift @ARGV)
dbg "filename: $file";
local ($test_date, $test_product, $test_branchid, $test_buildtype,
$test_os,
$test_machine,$test_global_target) = split /,/, $filename;
$test_os,
$test_machine,$test_global_target) = split /,/, $filename;
$test_branchid =~ s/[^0-9.]//g;
$test_global_target =~ s/.log$//;
@ -97,216 +99,331 @@ while ($file = shift @ARGV)
# dbg "test_machine: $test_machine";
# dbg "test_suite: $test_suite";
open FILE, "$file" or die "unable to open $file for reading: $!\n";
open FILE, "$file" or die "FATAL ERROR: unable to open $file for reading: $!\n";
dbg "process header with environment variables used in test";
while (<FILE>)
{
chomp;
# remove carriage returns, bels and other annoyances.
$_ =~ s/[\r]$//;
$_ =~ s/[\r]/CR/g;
$_ =~ s/[\x01-\x08]//g;
$_ =~ s/\s+$//;
dbg "INPUT: $_";
last if ( $_ =~ /^environment: EOF/);
if (($envvar, $envval) = $_ =~ /^environment: (TEST_[A-Z0-9_]*)=(.*)/ )
{
dbg "envvar=$envvar, envval=$envval";
$envvar =~ tr/A-Z/a-z/;
$$envvar = $envval;
dbg $envvar . "=" . $$envvar;
}
elsif (($envval) = $_ =~ /^environment: OSID=(.*)/ )
{
$test_os = $envval;
}
}
if ($test_product eq "js")
{
while (<FILE>)
{
chomp;
while (<FILE>)
{
chomp;
dbg "INPUT: $_";
dbg "INPUT: $_";
$_ =~ s/[\r]$//;
$_ =~ s/[\r]/CR/g;
$_ =~ s/[\x01-\x08]//g;
$_ =~ s/\s+$//;
$_ =~ s/[\r]$//;
$_ =~ s/[\r]/CR/g;
$_ =~ s/[\x01-\x08]//g;
$_ =~ s/\s+$//;
if ( $_ =~ /^jstest: /)
{
++$count_jstests;
next if ( $_ !~ /^jstest: /);
++$count_jstests;
($test_id) = $_ =~ /^jstest: (.*?) *bug:/;
($test_bug) = $_ =~ /bug: (.*?) *result:/;
($test_result) = $_ =~ /result: (.*?) *type:/;
($test_type) = $_ =~ /type: (.*?) *description:/;
($test_description) = $_ =~ /description: (.*)/;
($test_id) = $_ =~ /^jstest: (.*?) *bug:/;
($test_result) = $_ =~ /result: (.*?) *type:/;
($test_type) = $_ =~ /type: (.*?) *description:/;
($test_description) = $_ =~ /description: (.*)/;
if (!$test_description)
{
$test_description = "";
}
if (!$test_description)
{
$test_description = "";
}
else
{
($actual_exit, $actual_signal) = $test_description =~ /expected: Expected exit 0 actual: Actual exit ([0-9]*), signal ([0-9]*)/;
if (defined($actual_exit) or defined($actual_signal))
{
if ($actual_exit > 3 || $actual_signal > 0)
{
$test_description =~ s/ *expected: Expected exit 0 actual: Actual exit ([0-9]*), signal ([0-9]*) /EXIT STATUS: CRASHED $actual_exit signal $actual_signal, /;
}
}
elsif ($test_result eq "FAILED TIMED OUT")
{
$test_description = "EXIT STATUS: TIMED OUT, $test_description";
$test_result = "FAILED";
}
}
dbg "test_id: $test_id";
dbg "test_bug: $test_bug";
dbg "test_result: $test_result";
dbg "test_type: $test_type";
dbg "test_description: $test_description";
outputrecord;
dbg "test_id: $test_id";
dbg "test_result: $test_result";
dbg "test_type: $test_type";
dbg "test_description: $test_description";
dbg "-";
}
elsif (($envvar, $envval) = $_ =~ /^environment: (TEST_[A-Z0-9_]*)=(.*)/ )
{
dbg "envvar=$envvar, envval=$envval";
$envvar =~ tr/A-Z/a-z/;
$$envvar = $envval;
dbg $envvar . "=" . $$envvar;
}
elsif (($envval) = $_ =~ /^environment: OSID=(.*)/ )
{
$test_os = $envval;
}
}
outputrecord;
dbg "-";
}
}
elsif ($test_product eq "firefox")
{
$test_id = "__UNDEFINED__";
$test_bug = "__UNDEFINED__";
$test_result = "__UNDEFINED__";
$test_type = "__UNDEFINED__";
$test_description = "__UNDEFINED__";
$test_state = 'started program';
$test_buildtype = "nightly" unless $test_buildtype;
$test_type = "browser";
@messages = ();
$last_test = "__UNDEFINED__";
dbg "skip over test run start up";
$in_browser_test = 0;
@messages = ();
while (<FILE>)
{
chomp;
while (<FILE>)
{
chomp;
# remove carriage returns, bels and other annoyances.
$_ =~ s/[\r]$//;
$_ =~ s/[\r]/CR/g;
$_ =~ s/[\x01-\x08]//g;
$_ =~ s/\s+$//;
# remove carriage returns, bels and other annoyances.
$_ =~ s/[\r]$//;
$_ =~ s/[\r]/CR/g;
$_ =~ s/[\x01-\x08]//g;
$_ =~ s/\s+$//;
dbg "INPUT: $_";
dbg "INPUT: $_";
last if (/^Spider: Start/ && !/start-spider.html/);
}
if ( $_ =~ /^jstest: /)
{
++$count_jstests;
dbg "begin processing test results";
while (<FILE>)
{
chomp;
($test_id) = $_ =~ /^jstest: (.*?) *bug:/;
($test_bug) = $_ =~ /bug: (.*?) *result:/;
($test_result) = $_ =~ /result: (.*?) *type:/;
($test_type) = $_ =~ /type: (.*?) *description:/;
($test_description) = $_ =~ /description: (.*)/;
# remove carriage returns, bels and other annoyances.
$_ =~ s/[\r]$//;
$_ =~ s/[\r]/CR/g;
$_ =~ s/[\x01-\x08]//g;
$_ =~ s/\s+$//;
if (!$test_description)
{
$test_description = "";
}
dbg "INPUT: $_";
dbg "test_id: $test_id";
dbg "test_bug: $test_bug";
dbg "test_result: $test_result";
dbg "test_type: $test_type";
dbg "test_description: $test_description";
if ( /^Spider: Begin loading.*urllist/)
{
$test_state = 'loading list'; # optional, only if run in non-restart mode
dbg "ignore loading the test list when running in non restart mode"
}
elsif ( ($tmp_test_id) = $_ =~ /^Spider: Begin loading http.*test=([^;]*);/)
{
dbg "Begin loading $tmp_test_id";
dbg "test_result: $test_result";
die "FATAL ERROR: Spider Begin loading: previous test not completed: test: $test_id, current test: $tmp_test_id, test state: $test_state"
if ("started program, loading list, finished test, exited program" !~ /$test_state/);
outputrecord;
}
elsif ( ($test_id, $exit_status) = $_ =~
/^http:.*test=([^;]*);.*: EXIT STATUS: (.*)/)
{
dbg "Processing EXIT STATUS: test_id: $test_id, exit_status: $exit_status";
$test_state = 'loading test';
$test_id = $tmp_test_id;
$page_flag = '';
$page_status = '';
$exit_flag = '';
$exit_status = '';
@messages = ();
}
elsif ( ($tmp_test_id) = $_ =~ /^JavaScriptTest: Begin Test (.*)/)
{
dbg "Begin Test: test: $test_id, current test: $tmp_test_id";
$test_buildtype = "nightly" unless $test_buildtype;
$test_type = "browser";
die "FATAL ERROR: JavaScript Begin Test: test mismatch: test $test_id, current test $tmp_test_id"
if ($test_id ne $tmp_test_id);
if ($exit_status =~ /^NORMAL/)
{
if ($last_test ne $test_id)
{
++$count_exitonlytestsnormal;
die "FATAL ERROR: JavaScript Begin Test: test not loaded: test $test_id, current test $tmp_test_id, test state: $test_state"
if ("loading test" !~ /$test_state/);
$test_description = join '; ', @messages;
if ($test_description =~ /(out of memory|malloc:.*vm_allocate)/i)
{
$test_result = "FAILED";
}
else
{
$test_result = "FAILED";
}
# if we got here, the test terminated but it
# didn't report a result either because it
# crashed or the harness messed up.
outputrecord;
}
}
else
{
++$count_exitonlytestsabnormal;
$test_state = 'running test';
}
elsif ( $_ =~ /^jstest: /)
{
dbg "processing jstest";
dbg "Abnormal result";
# may be in 'completed test' for delayed browser only tests.
die "FATAL ERROR: jstest not in test: test state: $test_state: $_"
if ('running test, reporting test, completed test' !~ /$test_state/);
dbg "creating test_description from messages array";
$test_state = 'reporting test';
($tmp_test_id) = $_ =~ /^jstest: (.*?) *bug:/;
($test_result) = $_ =~ /result: (.*?) *type:/;
($tmp_test_type) = $_ =~ /type: (.*?) *description:/;
($test_description) = $_ =~ /description: (.*)/;
$test_description = join '; ', @messages;
# if we got here, the test terminated but it
# didn't report a result either because it is one
# of the old style -n.js negative tests, it
# crashed or the harness messed up.
if (!$test_description)
{
$test_description = "";
}
if ($test_id =~ /-n.js$/ && $test_description =~
/JavaScript (Exception|Error)/i)
{
# force -n.js tests which pass if they end
# with an error or exception to 'pass'
$test_result = "PASSED";
}
else
{
$test_result = "FAILED";
$test_description = "EXIT STATUS: $exit_status, $test_description";
}
outputrecord;
}
++$count_jstests;
$in_browser_test = 0;
@messages = ();
if ($debug)
{
dbg "tmp_test_id: $tmp_test_id";
dbg "test_result: $test_result";
dbg "tmp_test_type: $tmp_test_type";
dbg "test_description: $test_description";
}
dbg "not in browser test";
die "FATAL ERROR: jstest test id mismatch: start test_id: $test_id, current test_id: $tmp_test_id, test state: $test_state"
if ($test_id ne $tmp_test_id);
dbg "--";
die "FATAL ERROR: jstest test type mismatch: start test_type: $test_type, current test_type: $tmp_test_type, test state: $test_state"
if ($test_type ne $tmp_test_type);
}
elsif ( ($test_id) =
$_ =~ /Begin loading .*http.*test=([^;]*).*/)
{
dbg "Begin loading $test_id";
$in_browser_test = 1;
++$count_begintests;
}
elsif ( ($test_id) =
$_ =~ /Finish loading .*http.*test=([^;]*).*/)
{
dbg "Finish loading $test_id";
if ($test_id eq "__UNDEFINED__")
{
$test_id = $test_id;
}
dbg "test_id: $test_id, test_id: $test_id";
die if ($test_id ne $test_id);
}
elsif ($in_browser_test)
{
if (! /^[-+]{2,2}(WEBSHELL|DOMWINDOW)/ && ! /^Spider:/ && ! /^JavaScriptTest:/ && !/^WARNING:/)
{
outputrecord;
}
elsif ( $test_state ne 'loading list' && (($page_flag, $page_status) = $_ =~ /(http:[^:]*): PAGE STATUS: (.*)/) )
{
dbg "Processing PAGE STATUS: test_state: $test_state, page_flag: $page_flag, page_status: $page_status";
dbg "Saving message $_";
push @messages, ($_);
}
}
elsif (($envvar, $envval) = $_ =~ /^environment: (TEST_[A-Z0-9_]*)=(.*)/ )
{
dbg "envvar=$envvar, envval=$envval";
$envvar =~ tr/A-Z/a-z/;
$$envvar = $envval;
dbg $envvar . "=" . $$envvar;
}
elsif (($envval) = $_ =~ /^environment: OSID=(.*)/ )
{
$test_os = $envval;
}
}
die "FATAL ERROR: Test loaded but not in a test: $test_state: $_"
if ('loading test, running test, reporting test' !~ /$test_state/);
($tmp_test_id) = $page_flag =~ /http.*test=([^;]*);/;
die "FATAL ERROR: Test loaded does not match currently running test: test: $test_id, current test: $tmp_test_id"
if ($test_id ne $tmp_test_id);
if ($page_status =~ /^NORMAL/)
{
# since the deferred execution browser based tests finish loading before the
# tests executes, we must wait to handle the case where the test may have
# failed report any test results
}
elsif ($page_status =~ /^TIMED OUT/)
{
# if we got here, the test terminated because it
# is one of the old style -n.js negative tests, it
# crashed or the harness messed up.
dbg "Test $test_id timed out";
$test_description = join '; ', @messages;
$test_result = "FAILED";
$test_description = "EXIT STATUS: $page_status, $test_description";
outputrecord;
}
else
{
die "FATAL ERROR: Invalid Page Status: $page_status";
}
$test_state = 'completed test';
@messages = ();
}
elsif ( ($tmp_test_id) = $_ =~ /^JavaScriptTest: End Test (.*)/)
{
dbg "End test test_id: $test_id, tmp_test_id: $tmp_test_id";
die "FATAL ERROR: JavaScript End Test: test mismatch: test $test_id, current test $tmp_test_id"
if ($test_id ne $tmp_test_id);
die "FATAL ERROR: JavaScript End Test: not in a test: test $test_id, current test $tmp_test_id, test state: $test_state"
if ('reporting test, completed test' !~ /$test_state/);
if ($page_status && $page_status =~ /^NORMAL/)
{
dbg "Test $test_id loaded normally before the test was executed.";
if ($test_state eq 'running test')
{
# if we got here, the test completed loading but it
# didn't report a result before End Test was seen.
dbg "Test $test_id did not report any results";
# XXX: too much trouble updating failure list for the moment
# to make this change.
# $test_description = 'No test results reported. ' . (join '; ', @messages);
$test_description = (join '; ', @messages);
if ($test_id =~ /-n.js$/ && $test_description =~
/JavaScript (Exception|Error)/i)
{
# force -n.js tests which pass if they end
# with an error or exception to 'pass'
$test_result = "PASSED";
}
else
{
$test_result = "FAILED";
}
outputrecord;
}
}
$test_state = 'finished test';
}
elsif ( ($exit_flag, $exit_status) = $_ =~ /(http:[^:]*): EXIT STATUS: (.*)/ )
{
dbg "Processing EXIT STATUS: exit_flag: $exit_flag, exit_status: $exit_status";
if ($exit_status =~ /^NORMAL/)
{
dbg "Program exited normally";
die "FATAL ERROR: Program exited normally without running tests: test state: $test_state, $_"
if ('started program, loading list' =~ /$test_state/);
die "FATAL ERROR: Program exited normally without finishing last test: test state: $test_state, $_"
if ($test_state ne 'finished test');
}
else
{
dbg "Program exited abnormally: test state: $test_state";
if ($test_state eq 'finished test' && $exit_status =~ /^TIMED OUT/)
{
# as long as the program time out is greater than the page time out
# this will have been reported already by the End Test page status code
}
else
{
$test_result = "FAILED";
$test_description = join '; ', @messages;
if ($test_state eq 'running test')
{
$test_description = "No test results reported. $test_description";
}
$test_description = "EXIT STATUS: $exit_status, $test_description";
outputrecord;
}
}
$test_state = 'exited program';
@messages = ();
}
elsif (!/^[-+]{2,2}(WEBSHELL|DOMWINDOW)/ && !/^Spider:/ && !/^JavaScriptTest:/ && !/^WARNING:/)
{
dbg "Saving message $_";
push @messages, ($_);
}
}
}
close FILE;
@ -324,25 +441,17 @@ outresults;
unlink $temp;
if ($DEBUG)
if ($debug)
{
print "begintests $count_begintests\n";
print "jstests $count_jstests\n";
print "exit normal $count_exitonlytestsnormal\n";
print "exit abnormal $count_exitonlytestsabnormal\n";
print "total records $count_records\n";
print "jstests + exit normal + exit abnormal = " . ($count_jstests + $count_exitonlytestsnormal + $count_exitonlytestsabnormal) . "\n";
dbg "jstests $count_jstests\n";
dbg "total records $count_records\n";
}
die "test counts do not match: total records $count_records; jstests + exit normal + exit abnormal = " .
($count_jstests + $count_exitonlytestsnormal + $count_exitonlytestsabnormal) . "\n"
if ($count_records != ($count_jstests + $count_exitonlytestsnormal + $count_exitonlytestsabnormal));
sub dbg {
if ($DEBUG)
if ($debug)
{
my $msg = shift;
print STDOUT "DEBUG: $msg\n";
my $msg = shift;
print STDERR "DEBUG: $msg\n";
}
}
@ -361,29 +470,20 @@ sub outputrecord
if (length($test_description) > 6000)
{
$test_description = substr($test_description, 0, 6000);
$test_description = substr($test_description, 0, 6000);
}
my $output =
"TEST_ID=$test_id, TEST_BRANCH=$test_branchid, TEST_RESULT=$test_result, " .
"TEST_BUILDTYPE=$test_buildtype, TEST_TYPE=$test_type, TEST_OS=$test_os, " .
"TEST_MACHINE=$test_machine, TEST_PROCESSORTYPE=$test_processortype, " .
"TEST_KERNEL=$test_kernel, TEST_DATE=$test_date, TEST_TIMEZONE=$test_timezone, " .
"TEST_DESCRIPTION=$test_description\n";
"TEST_ID=$test_id, TEST_BRANCH=$test_branchid, TEST_RESULT=$test_result, " .
"TEST_BUILDTYPE=$test_buildtype, TEST_TYPE=$test_type, TEST_OS=$test_os, " .
"TEST_MACHINE=$test_machine, TEST_PROCESSORTYPE=$test_processortype, " .
"TEST_KERNEL=$test_kernel, TEST_DATE=$test_date, TEST_TIMEZONE=$test_timezone, " .
"TEST_DESCRIPTION=$test_description\n";
if ($DEBUG)
if ($debug)
{
print "RECORD: $output";
dbg "RECORD: $output";
}
print TEMP $output;
$last_test = $test_id;
$test_id = "__UNDEFINED__";
$test_bug = "__UNDEFINED__";
$test_result = "__UNDEFINED__";
$test_type = "__UNDEFINED__";
$test_description = "__UNDEFINED__";
}

Просмотреть файл

@ -59,7 +59,6 @@ usage()
{
cat <<EOF
usage: process-logs.sh.sh -l testlogfiles -A arch -K kernel
usage: process-logs.sh.sh -l $testlogfiles -A $arch -K $kernel
variable description
=============== ============================================================
@ -103,71 +102,89 @@ fi
for testlogfile in `ls $testlogfiles`; do
debug "testlogfile=$testlogfile"
case "$testlogfile" in
*,js,*) testtype=shell;;
*,firefox,*) testtype=browser;;
*) error "unknown testtype in logfile $testlogfile";;
*) error "unknown testtype in logfile $testlogfile" $LINENO;;
esac
debug "testtype=$testtype"
case "$testlogfile" in
*,nightly,*) buildtype=nightly;;
*,opt,*) buildtype=opt;;
*,debug,*) buildtype=debug;;
*) error "unknown buildtype in logfile $testlogfile";;
*) error "unknown buildtype in logfile $testlogfile" $LINENO;
esac
debug "buildtype=$buildtype"
case "$testlogfile" in
*,1.8.0*) branch=1.8.0;;
*,1.8.1*) branch=1.8.1;;
*,1.9.0*) branch=1.9.0;;
*)
branch=`grep TEST_BRANCH= $testlogfile | sed 's|.*TEST_BRANCH=\(.*\)|\1|'`
branch=`grep '^environment: TEST_BRANCH=' $testlogfile | sed 's|.*TEST_BRANCH=\(.*\)|\1|'`
if [[ -z "$branch" ]]; then
error "unknown branch in logfile $testlogfile"
error "unknown branch in logfile $testlogfile" $LINENO
fi
;;
esac
debug "branch=$branch"
case "$testlogfile" in
*,win32,*) OSID=win32;;
*,linux,*) OSID=linux;;
*,mac,*) OSID=mac;;
*)
OSID=`grep OSID= $testlogfile | sed 's|.*OSID=\(.*\)|\1|'`
OSID=`grep '^environment: OSID=' $testlogfile | sed 's|.*OSID=\(.*\)|\1|'`
if [[ -z "$OSID" ]]; then
error "unknown OS in logfile $testlogfile"
error "unknown OS in logfile $testlogfile" $LINENO
fi
;;
esac
debug "OSID=$OSID"
if [[ -n "$optkernel" ]]; then
kernel="$optkernel"
else
if [[ "$OSID" == "win32" ]]; then
kernel=all
else
kernel=`grep TEST_KERNEL $testlogfile | sed 's|.*TEST_KERNEL=\(.*\)|\1|'`
kernel=`grep '^environment: TEST_KERNEL=' $testlogfile | sed 's|.*TEST_KERNEL=\(.*\)|\1|'`
kernel=`echo $kernel | sed 's|\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[-.0-9]*\.\([a-zA-Z0-9]*\)|\1.\2.\3.*\4|'`
fi
fi
debug "kernel=$kernel"
if [[ -n "$optarch" ]]; then
arch="$optarch"
else
if [[ "$OSID" == "win32" ]]; then
arch=all
else
arch=`grep TEST_PROCESSORTYPE $testlogfile | sed 's|.*TEST_PROCESSORTYPE=\(.*\)|\1|'`
arch=`grep '^environment: TEST_PROCESSORTYPE=' $testlogfile | sed 's|.*TEST_PROCESSORTYPE=\(.*\)|\1|'`
fi
fi
timezone=`echo $testlogfile | sed 's|^[-0-9]*\([-+]\)\([0-9]\{4,4\}\),.*|\1\2|'`
debug "arch=$arch"
timezone=`basename $testlogfile | sed 's|^[-0-9]*\([-+]\)\([0-9]\{4,4\}\),.*|\1\2|'`
debug "timezone=$timezone"
outputprefix=$testlogfile
if [[ -n "$DEBUG" ]]; then
dumpvars branch buildtype testtype OSID timezone testlogfile arch kernel
fi
includetests="included-$branch-$testtype-$buildtype.tests"
excludetests="excluded-$branch-$testtype-$buildtype.tests"
grep '^include: ' $testlogfile | sed 's|include: ||' > $TEST_DIR/tests/mozilla.org/js/$includetests
grep '^exclude: ' $testlogfile | sed 's|exclude: ||' > $TEST_DIR/tests/mozilla.org/js/$excludetests
$TEST_DIR/tests/mozilla.org/js/known-failures.pl -b "$branch" -T "$buildtype" -t "$testtype" -o "$OSID" -z "$timezone" -l "$testlogfile" -A "$arch" -K "$kernel" -r "$TEST_JSDIR/failures.txt" -O "$outputprefix"

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -70,8 +70,8 @@ source ${TEST_BIN}/library.sh
usage()
{
cat <<EOF
usage: runtests.sh -p products -b branches -T buildtypes -B buildcommands [-e extra] [-v]
usage: runtests.sh -p "$products" -b "$branches" -T "$buildtypes" -B "$buildcommands" -e "$extra"
usage: runtests.sh -p products -b branches -T buildtypes -B buildcommands -e extra [-v] \\
-S -R -X exclude -I include -c -t
variable description
=============== ============================================================
@ -87,6 +87,29 @@ variable description
-v optional. verbose - copies log file output to stdout.
-S optional. summary - output tailered for use with
Buildbot|Tinderbox
-R optional. by default the browser test will start Firefox
Spider and execute the tests one after another in the same
process. -R will start an new instance of Firefox for each
test. This has no effect for shell based tests.
-X exclude optional. By default the test will exclude the
tests listed in spidermonkey-n-\$branch.tests,
performance-\$branch.tests. exclude is a list of either
individual tests, manifest files or sub-directories which
will override the default exclusion list.
-I include optional. By default the test will include the
JavaScript tests appropriate for the branch. include is a
list of either individual tests, manifest files or
sub-directories which will override the default inclusion
list.
-c optional. By default the test will exclude tests
which crash on this branch, test type, build type and
operating system. -c will include tests which crash.
Typically this should only be used in combination with -R.
This has no effect on shell based tests which execute crash
tests regardless.
-t optional. By default the test will exclude tests
which time out on this branch, test type, build type and
operating system. -t will include tests which timeout.
if an argument contains more than one value, it must be quoted.
EOF
@ -95,19 +118,24 @@ EOF
verbose=0
while getopts "p:b:T:B:e:vS" optname;
do
case $optname in
p) products=$OPTARG;;
b) branches=$OPTARG;;
T) buildtypes=$OPTARG;;
e) extra="$OPTARG"
extraflag="-e $OPTARG";;
B) buildcommands=$OPTARG;;
v) verbose=1
verboseflag="-v";;
S) summary=1;;
esac
while getopts "p:b:T:B:e:X:I:vSRct" optname;
do
case $optname in
p) products=$OPTARG;;
b) branches=$OPTARG;;
T) buildtypes=$OPTARG;;
e) extra="$OPTARG"
extraflag="-e $OPTARG";;
B) buildcommands=$OPTARG;;
v) verbose=1
verboseflag="-v";;
R) restart=1;;
S) summary=1;;
X) exclude=$OPTARG;;
I) include=$OPTARG;;
c) crashes=1;;
t) timeouts=1;;
esac
done
if [[ -z "$products" || -z "$branches" || -z "$buildtypes" ]]; then
@ -130,6 +158,7 @@ case $buildtypes in
esac
testlogfilelist=`mktemp /tmp/TESTLOGFILES.XXXX`
trap "_exit; rm -f $testlogfilelist" EXIT
export testlogfiles
export testlogfile
@ -139,13 +168,18 @@ export testlogfile
# look into the testlogfilelist for the error
branchesextra=`combo.sh -d - "$branches" "$extra"`
# can't test tester.sh's exit code to see if there was
# an error since we are piping it and can't count on pipefail
tester.sh -t $TEST_JSDIR/test.sh $verboseflag "$products" "$branchesextra" "$buildtypes" 2>&1 | tee -a $testlogfilelist
if grep -q 'test-setup.sh failed' $testlogfilelist; then
error "runtests.sh: terminating due to error"
fi
testlogfiles="`grep '^log:' $testlogfilelist|sed 's|^log: ||'`"
rm $testlogfilelist
fatalerrors=`grep 'FATAL ERROR' $testlogfiles | cat`
if [[ -n "$fatalerrors" ]]; then
testlogarray=( $testlogfiles )
let itestlog=${#testlogarray[*]}-1
error "`tail -n 20 ${testlogarray[$itestlog]}`" $LINENO
fi
case "$OSID" in
win32)
@ -161,26 +195,31 @@ case "$OSID" in
kernel=all
;;
*)
error "$OSID not supported"
error "$OSID not supported" $LINENO
;;
esac
for testlogfile in $testlogfiles; do
if [[ -n "$DEBUG" ]]; then
dumpvars testlogfile
fi
case "$testlogfile" in
*,js,*) testtype=shell;;
*,firefox,*) testtype=browser;;
*) error "unknown testtype in logfile $testlogfile";;
*) error "unknown testtype in logfile $testlogfile" $LINENO;;
esac
case "$testlogfile" in
*,opt,*) buildtype=opt;;
*,debug,*) buildtype=debug;;
*) error "unknown buildtype in logfile $testlogfile";;
*) error "unknown buildtype in logfile $testlogfile" $LINENO;;
esac
case "$testlogfile" in
*,1.8.0*) branch=1.8.0;;
*,1.8.1*) branch=1.8.1;;
*,1.9.0*) branch=1.9.0;;
*) error "unknown branch in logfile $testlogfile";;
*) error "unknown branch in logfile $testlogfile" $LINENO;;
esac
outputprefix=$testlogfile
@ -189,7 +228,7 @@ for testlogfile in $testlogfiles; do
fi
if ! $TEST_DIR/tests/mozilla.org/js/known-failures.pl -b $branch -T $buildtype -t $testtype -o "$OSID" -z `date +%z` -l $testlogfile -A "$arch" -K "$kernel" -r $TEST_JSDIR/failures.txt -O $outputprefix; then
error "known-failures.pl"
error "known-failures.pl" $LINENO
fi
if [[ -n "$summary" ]]; then
@ -211,7 +250,9 @@ for testlogfile in $testlogfiles; do
cat "${outputprefix}-results-possible-fixes.log"
echo -e "\nPossible Regressions:\n"
cat "${outputprefix}-results-possible-regressions.log"
echo -e "\nTinderboxPrint: js tests<br/>$branch $buildtype $testtype<br/>$npass/$nfail<br/>F:$nfixes R:$nregressions"
echo -e "\nTinderboxPrint:<div title=\"$testlogfile\">\n"
echo -e "\nTinderboxPrint:js tests<br/>$branch $buildtype $testtype<br/>$npass/$nfail<br/>F:$nfixes R:$nregressions"
echo -e "\nTinderboxPrint:</div>\n"
fi
done

Просмотреть файл

@ -164,11 +164,13 @@ js1_5/extensions/regress-354541-03.js
js1_5/extensions/regress-354541-04.js
js1_5/extensions/regress-355339.js
js1_5/extensions/regress-355497.js
js1_5/extensions/regress-355622.js
js1_5/extensions/regress-355655.js
js1_5/extensions/regress-355736.js
js1_5/extensions/regress-355820.js
js1_5/extensions/regress-355982.js
js1_5/extensions/regress-356085.js
js1_5/extensions/regress-356106.js
js1_5/extensions/regress-356402.js
js1_5/extensions/regress-358594-01.js
js1_5/extensions/regress-358594-02.js
@ -212,11 +214,13 @@ js1_5/extensions/regress-374589.js
js1_5/extensions/regress-375183.js
js1_5/extensions/regress-375801.js
js1_5/extensions/regress-376052.js
js1_5/extensions/regress-379523.js
js1_5/extensions/regress-380581.js
js1_5/extensions/regress-380831.js
js1_5/extensions/regress-380889.js
js1_5/extensions/regress-381205.js
js1_5/extensions/regress-381211.js
js1_5/extensions/regress-381304.js
js1_5/extensions/regress-382509.js
js1_5/extensions/regress-383965.js
js1_5/extensions/regress-384680.js
@ -244,6 +248,7 @@ js1_5/extensions/toLocaleFormat-02.js
js1_6/extensions/regress-312385-01.js
js1_6/extensions/regress-352392.js
js1_6/extensions/regress-385393-08.js
js1_6/extensions/regress-414098.js
js1_7/extensions/basic-for-each.js
js1_7/extensions/basic-for-in.js
js1_7/extensions/basic-Iterator.js

Просмотреть файл

@ -0,0 +1,91 @@
# Obsolete SpiderMonkey tests
#
# invalidated by bug 10278
#
ecma_2/Exceptions/function-001.js
js1_2/function/function-001-n.js
js1_3/Script/function-001-n.js
js1_3/regress/function-001-n.js
#
# WONTFIX bug 119719
#
js1_5/Regress/regress-119719.js
#
# Spidermonkey now defaults lineNumber and fileName
# to the location and file where the exception occured.
# exclude original test which assumes the defaults are
# 0 and ''
#
js1_5/extensions/regress-50447.js
#
# Invalid bug
#
e4x/Regress/regress-278112.js
#
# behavior changed to match MSIE/Opera/etc
# see bug 309840
#
js1_5/Regress/regress-173067.js
#
# per comment in bug, this test is obsolete
# for spidermonkey and rhino.
#
ecma_3/Statements/regress-121744.js
#
# remove version dependent tests
# see bug 325921
#
js1_2/Array/array_split_1.js
js1_2/Array/tostring_1.js
js1_2/Array/tostring_2.js
js1_2/Objects/toString-001.js
js1_2/String/concat.js
js1_2/function/Function_object.js
js1_2/function/Number.js
js1_2/function/String.js
js1_2/function/function-001-n.js
js1_2/function/length.js
js1_2/function/regexparg-2-n.js
js1_2/function/tostring-1.js
js1_2/function/tostring-2.js
js1_2/operator/equality.js
js1_2/regexp/RegExp_lastIndex.js
js1_2/regexp/string_split.js
js1_2/version120/boolean-001.js
js1_2/version120/regress-99663.js
js1_3/Script/delete-001.js
js1_3/Script/function-001-n.js
js1_3/regress/delete-001.js
js1_3/regress/function-001-n.js
#
# tests not yet implemented
#
e4x/TypeConversion/10.5.1.js
e4x/TypeConversion/10.5.js
e4x/TypeConversion/10.6.1.js
e4x/TypeConversion/10.6.js
e4x/Types/9.1.1.10.js
e4x/Types/9.1.1.11.js
e4x/Types/9.1.1.12.js
e4x/Types/9.1.1.13.js
e4x/Types/9.1.1.4.js
e4x/Types/9.1.1.5.js
e4x/Types/9.1.1.7.js
e4x/Types/9.1.1.8.js
e4x/Types/9.2.1.10.js
e4x/Types/9.2.1.3.js
e4x/Types/9.2.1.4.js
e4x/Types/9.2.1.5.js
e4x/Types/9.2.1.6.js
e4x/Types/9.2.1.7.js
e4x/XML/13.4.4.1.js
ecma_2/RegExp/exec-001.js
ecma_2/String/replace-001.js
#
# pre ecma warnings are doa
#
js1_5/Regress/regress-106244.js
#
# do not ignore unicode formatting chars/trunk - bug 274152
#
ecma_3/Unicode/uc-001.js

Просмотреть файл

@ -0,0 +1,91 @@
# Obsolete SpiderMonkey tests
#
# invalidated by bug 10278
#
ecma_2/Exceptions/function-001.js
js1_2/function/function-001-n.js
js1_3/Script/function-001-n.js
js1_3/regress/function-001-n.js
#
# WONTFIX bug 119719
#
js1_5/Regress/regress-119719.js
#
# Spidermonkey now defaults lineNumber and fileName
# to the location and file where the exception occured.
# exclude original test which assumes the defaults are
# 0 and ''
#
js1_5/extensions/regress-50447.js
#
# Invalid bug
#
e4x/Regress/regress-278112.js
#
# behavior changed to match MSIE/Opera/etc
# see bug 309840
#
js1_5/Regress/regress-173067.js
#
# per comment in bug, this test is obsolete
# for spidermonkey and rhino.
#
ecma_3/Statements/regress-121744.js
#
# remove version dependent tests
# see bug 325921
#
js1_2/Array/array_split_1.js
js1_2/Array/tostring_1.js
js1_2/Array/tostring_2.js
js1_2/Objects/toString-001.js
js1_2/String/concat.js
js1_2/function/Function_object.js
js1_2/function/Number.js
js1_2/function/String.js
js1_2/function/function-001-n.js
js1_2/function/length.js
js1_2/function/regexparg-2-n.js
js1_2/function/tostring-1.js
js1_2/function/tostring-2.js
js1_2/operator/equality.js
js1_2/regexp/RegExp_lastIndex.js
js1_2/regexp/string_split.js
js1_2/version120/boolean-001.js
js1_2/version120/regress-99663.js
js1_3/Script/delete-001.js
js1_3/Script/function-001-n.js
js1_3/regress/delete-001.js
js1_3/regress/function-001-n.js
#
# tests not yet implemented
#
e4x/TypeConversion/10.5.1.js
e4x/TypeConversion/10.5.js
e4x/TypeConversion/10.6.1.js
e4x/TypeConversion/10.6.js
e4x/Types/9.1.1.10.js
e4x/Types/9.1.1.11.js
e4x/Types/9.1.1.12.js
e4x/Types/9.1.1.13.js
e4x/Types/9.1.1.4.js
e4x/Types/9.1.1.5.js
e4x/Types/9.1.1.7.js
e4x/Types/9.1.1.8.js
e4x/Types/9.2.1.10.js
e4x/Types/9.2.1.3.js
e4x/Types/9.2.1.4.js
e4x/Types/9.2.1.5.js
e4x/Types/9.2.1.6.js
e4x/Types/9.2.1.7.js
e4x/XML/13.4.4.1.js
ecma_2/RegExp/exec-001.js
ecma_2/String/replace-001.js
#
# pre ecma warnings are doa
#
js1_5/Regress/regress-106244.js
#
# do not ignore unicode formatting chars/trunk - bug 274152
#
ecma_3/Unicode/uc-001.js

Просмотреть файл

@ -0,0 +1,91 @@
# Obsolete SpiderMonkey tests
#
# invalidated by bug 10278
#
ecma_2/Exceptions/function-001.js
js1_2/function/function-001-n.js
js1_3/Script/function-001-n.js
js1_3/regress/function-001-n.js
#
# WONTFIX bug 119719
#
js1_5/Regress/regress-119719.js
#
# Spidermonkey now defaults lineNumber and fileName
# to the location and file where the exception occured.
# exclude original test which assumes the defaults are
# 0 and ''
#
js1_5/extensions/regress-50447.js
#
# Invalid bug
#
e4x/Regress/regress-278112.js
#
# behavior changed to match MSIE/Opera/etc
# see bug 309840
#
js1_5/Regress/regress-173067.js
#
# per comment in bug, this test is obsolete
# for spidermonkey and rhino.
#
ecma_3/Statements/regress-121744.js
#
# remove version dependent tests
# see bug 325921
#
js1_2/Array/array_split_1.js
js1_2/Array/tostring_1.js
js1_2/Array/tostring_2.js
js1_2/Objects/toString-001.js
js1_2/String/concat.js
js1_2/function/Function_object.js
js1_2/function/Number.js
js1_2/function/String.js
js1_2/function/function-001-n.js
js1_2/function/length.js
js1_2/function/regexparg-2-n.js
js1_2/function/tostring-1.js
js1_2/function/tostring-2.js
js1_2/operator/equality.js
js1_2/regexp/RegExp_lastIndex.js
js1_2/regexp/string_split.js
js1_2/version120/boolean-001.js
js1_2/version120/regress-99663.js
js1_3/Script/delete-001.js
js1_3/Script/function-001-n.js
js1_3/regress/delete-001.js
js1_3/regress/function-001-n.js
#
# tests not yet implemented
#
e4x/TypeConversion/10.5.1.js
e4x/TypeConversion/10.5.js
e4x/TypeConversion/10.6.1.js
e4x/TypeConversion/10.6.js
e4x/Types/9.1.1.10.js
e4x/Types/9.1.1.11.js
e4x/Types/9.1.1.12.js
e4x/Types/9.1.1.13.js
e4x/Types/9.1.1.4.js
e4x/Types/9.1.1.5.js
e4x/Types/9.1.1.7.js
e4x/Types/9.1.1.8.js
e4x/Types/9.2.1.10.js
e4x/Types/9.2.1.3.js
e4x/Types/9.2.1.4.js
e4x/Types/9.2.1.5.js
e4x/Types/9.2.1.6.js
e4x/Types/9.2.1.7.js
e4x/XML/13.4.4.1.js
ecma_2/RegExp/exec-001.js
ecma_2/String/replace-001.js
#
# pre ecma warnings are doa
#
js1_5/Regress/regress-106244.js
#
# do not ignore unicode formatting chars/trunk - bug 274152
#
ecma_3/Unicode/uc-001.js

Просмотреть файл

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
@ -68,25 +68,50 @@ fi
source ${TEST_BIN}/library.sh
TEST_JSEACH_TIMEOUT=${TEST_JSEACH_TIMEOUT:-900}
TEST_JSEACH_PAGE_TIMEOUT=${TEST_JSEACH_PAGE_TIMEOUT:-900}
TEST_JSEACH_PAGE_TIMEOUT=${TEST_JSEACH_PAGE_TIMEOUT:-840}
TEST_JSALL_TIMEOUT=${TEST_JSALL_TIMEOUT:-10800}
TEST_WWW_JS=`echo $TEST_JSDIR|sed "s|$TEST_DIR||"`
#
# options processing
#
options="p:b:x:N:d:"
usage()
{
cat <<EOF
usage: $SCRIPT -p product -b branch -x executablepath -N profilename
usage: $SCRIPT -p product -b branch -T buildtype -x executablepath -N profilename \\
-R -X exclude -I include -c -t -F [-d datafiles]
variable description
=============== ============================================================
-p product required. firefox|thunderbird
-b branch required. 1.8.0|1.8.1|1.9.0
-T buildtype required. one of opt debug
-x executablepath required. directory-tree containing executable 'product'
-N profilename required. profile name
-R optional. by default the browser test will start Firefox
spider and execute the tests one after another in the same
process. -R will start an new instance of Firefox for each
test.
-X exclude optional. By default the test will exclude the
tests listed in spidermonkey-n-\$branch.tests,
performance-\$branch.tests. exclude is a list of either
individual tests, manifest files or sub-directories which
will override the default exclusion list.
-I include optional. By default the test will include the
JavaScript tests appropriate for the branch. include is a
list of either individual tests, manifest files or
sub-directories which will override the default inclusion
list.
-c optional. By default the test will exclude tests
which crash on this branch, test type, build type and
operating system. -c will include tests which crash.
Typically this should only be used in combination with -R.
This has no effect on shell based tests which execute crash
tests regardless.
-t optional. By default the test will exclude tests
which time out on this branch, test type, build type and
operating system. -t will include tests which timeout.
-F optional. Just generate file lists without running any tests.
-d datafiles optional. one or more filenames of files containing
environment variable definitions to be included.
@ -98,15 +123,20 @@ EOF
exit 2
}
unset product branch profilename executablepath datafiles
while getopts $options optname ;
while getopts "p:b:T:x:N:d:X:I:RctF" optname
do
case $optname in
p) product=$OPTARG;;
b) branch=$OPTARG;;
T) buildtype=$OPTARG;;
N) profilename=$OPTARG;;
x) executablepath=$OPTARG;;
R) restart=1;;
X) exclude=$OPTARG;;
I) include=$OPTARG;;
c) crashes=1;;
t) timeouts=1;;
F) filesonly=1;;
d) datafiles=$OPTARG;;
esac
done
@ -118,38 +148,191 @@ if [[ -n "$datafiles" ]]; then
done
fi
dumpvars product branch buildtype profilename executablepath restart exclude include crashes timeouts filesonly datafiles | sed "s|^|arguments: |"
if [[ -z "$product" || -z "$branch" || -z "$executablepath" || -z "$profilename" ]]; then
usage
fi
executable=`get_executable $product $branch $executablepath`
case "$branch" in
1.8.0)
list=1.8.0-list.txt
pushd $TEST_JSDIR
rm -f finished-$branch-browser-$buildtype
if ! make failures.txt; then
error "during make failures.txt" $LINENO
fi
includetests="included-$branch-browser-$buildtype.tests"
rm -f $includetests
touch $includetests
if [[ -z "$include" ]]; then
# by default include tests appropriate for the branch
include="e4x ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6"
case "$branch" in
1.8.0)
;;
1.8.1)
include="$include js1_7"
;;
1.9.0)
include="$include js1_7 js1_8"
;;
esac
fi
for i in $include; do
if [[ -f "$i" ]]; then
echo "# including $i" >> $includetests
if echo $i | grep -q '\.js$'; then
echo $i >> $includetests
else
cat $i >> $includetests
fi
elif [[ -d "$i" ]]; then
find $i -name '*.js' -print | egrep -v '(shell|browser|template|jsref|userhook.*|\.#.*)\.js' | sed 's/^\.\///' | sort >> $includetests
fi
done
excludetests="excluded-$branch-browser-$buildtype.tests"
rm -f $excludetests
touch $excludetests
if [[ -z "$exclude" ]]; then
exclude="spidermonkey-n-$branch.tests performance-$branch.tests"
fi
for e in $exclude; do
if [[ -f "$e" ]]; then
echo "# excluding $e" >> $excludetests
if echo $e | grep -q '\.js$'; then
echo $e >> $excludetests
else
cat $e >> $excludetests
fi
elif [[ -d "$e" ]]; then
find $e -name '*.js' -print | egrep -v '(shell|browser|template|jsref|userhook.*|\.#.*)\.js' | sed 's/^\.\///' | sort >> $excludetests
fi
done
case "$OSID" in
win32)
arch='.*'
kernel='.*'
;;
1.8.1)
list=1.8.1-list.txt
linux)
arch="`uname -p`"
kernel="`uname -r | sed 's|\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[-.0-9]*\.\([a-zA-Z0-9]*\)|\1.\2.\3.*\4|'`"
;;
1.9.0)
list=1.9.0-list.txt
mac)
arch="`uname -p`"
kernel='[^,]*'
;;
*)
error "$OSID not supported" $LINENO
;;
esac
pushd $TEST_JSDIR
if [[ -z "$timeouts" ]]; then
echo "# exclude tests that time out" >> $excludetests
egrep "TEST_BRANCH=([^,]*$branch[^,]*|[.][*]), TEST_RESULT=FAILED, TEST_BUILDTYPE=([^,]*$buildtype[^,]*|[.][*]), TEST_TYPE=([^,]*browser[^,]*|[.][*]), TEST_OS=([^,]*$OSID[^,]*|[.][*]), .*, TEST_PROCESSORTYPE=([^,]*$arch[^,]*|[.][*]), TEST_KERNEL=([^,]*$kernel[^,]*|[.][*]), .*, TEST_DESCRIPTION=.*EXIT STATUS: TIMED OUT" \
failures.txt | sed 's/TEST_ID=\([^,]*\),.*/\1/' | sort | uniq >> $excludetests
fi
# clock skew causes failures. clean first
make clean
make
if [[ -z "$crashes" ]]; then
echo "# exclude tests that crash" >> $excludetests
pattern="TEST_BRANCH=([^,]*$branch[^,]*|[.][*]), TEST_RESULT=FAILED, TEST_BUILDTYPE=([^,]*$buildtype[^,]*|[.][*]), TEST_TYPE=([^,]*browser[^,]*|[.][*]), TEST_OS=([^,]*$OSID[^,]*|[.][*]), .*, TEST_PROCESSORTYPE=([^,]*$arch[^,]*|[.][*]), TEST_KERNEL=([^,]*$kernel[^,]*|[.][*]), .*, TEST_DESCRIPTION=.*"
case "$buildtype" in
opt)
pattern="${pattern}EXIT STATUS: CRASHED"
;;
debug)
pattern="${pattern}(EXIT STATUS: CRASHED|Assertion failure:)"
;;
esac
egrep "$pattern" failures.txt | sed 's/TEST_ID=\([^,]*\),.*/\1/' | sort | uniq >> $excludetests
cat "$list" | while read url; do
edit-talkback.sh -p "$product" -b "$branch" -x "$executablepath" -i "$url"
time timed_run.py $TEST_JSEACH_TIMEOUT "$url" \
"$executable" -P "$profilename" \
-spider -start -quit \
-uri "$url" \
-depth 0 -timeout "$TEST_JSEACH_PAGE_TIMEOUT" \
-hook "http://$TEST_HTTP$TEST_WWW_JS/userhookeach.js";
fi
urllist="urllist-$branch-browser-$buildtype.tests"
urlhtml="urllist-$branch-browser-$buildtype.html"
rm -f $urllist $urlhtml
cat > $urlhtml <<EOF
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JavaScript Tests</title>
</head>
<body>
<ul>
EOF
cat $includetests | while read jsfile
do
if echo $jsfile | grep -q '^#'; then
continue
fi
if ! grep -q $jsfile $excludetests; then
result=`echo $jsfile | sed 's/.*js\([0-9]\)_\([0-9]\).*/\1.\2/'`
case $result in
1.5) version=";version=1.5";;
1.6) version=";version=1.6";;
1.7) version=";version=1.7";;
1.8) version=";version=1.8";;
1.9) version=";version=1.9";;
2.0) version=";version=2.0";;
*) version="";;
esac
echo "http://$TEST_HTTP$TEST_WWW_JS/js-test-driver-standards.html?test=$jsfile;language=type;text/javascript$version" >> $urllist
echo "<li><a href='http://$TEST_HTTP$TEST_WWW_JS/js-test-driver-standards.html?test=$jsfile;language=type;text/javascript$version'>$jsfile</a></li>" >> $urlhtml
fi
done
cat >> $urlhtml <<EOF
</ul>
</body>
</html>
EOF
chmod a+r $urlhtml
cat $includetests | sed 's|^|include: |'
cat $excludetests | sed 's|^|exclude: |'
if [[ -z "$filesonly" ]]; then
if [[ "$restart" == "1" ]]; then
cat "$urllist" | while read url;
do
edit-talkback.sh -p "$product" -b "$branch" -x "$executablepath" -i "$url"
if time timed_run.py $TEST_JSEACH_TIMEOUT "$url" \
"$executable" -P "$profilename" \
-spider -start -quit \
-uri "$url" \
-depth 0 -timeout "$TEST_JSEACH_PAGE_TIMEOUT" \
-hook "http://$TEST_HTTP$TEST_WWW_JS/userhookeach.js"; then
true;
fi
done
else
edit-talkback.sh -p "$product" -b "$branch" -x "$executablepath" -i "http://$TEST_HTTP$TEST_WWW_JS/$urlhtml"
if ! time timed_run.py $TEST_JSALL_TIMEOUT "http://$TEST_HTTP$TEST_WWW_JS/$urlhtml" \
"$executable" -P "$profilename" \
-spider -start -quit \
-uri "http://$TEST_HTTP$TEST_WWW_JS/$urlhtml" \
-depth 1 -timeout "$TEST_JSEACH_PAGE_TIMEOUT" \
-hook "http://$TEST_HTTP$TEST_WWW_JS/userhookeach.js"; then
error "timed_run.py ended abnormally: $?" $LINENO
fi
fi
fi
popd

Просмотреть файл

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
@ -67,12 +67,12 @@ fi
source ${TEST_BIN}/library.sh
TEST_JSSHELL_TIMEOUT=${TEST_JSSHELL_TIMEOUT:-900}
#
# options processing
#
options="b:s:T:d:"
usage()
{
cat <<EOF
@ -84,6 +84,25 @@ variable description
-b branch required. 1.8.0|1.8.1|1.9.0
-s sourcepath required. path to js shell source directory mozilla/js/src
-T buildtype required. one of opt debug
-X exclude optional. By default the test will exclude the
tests listed in spidermonkey-n-\$branch.tests,
performance-\$branch.tests. exclude is a list of either
individual tests, manifest files or sub-directories which
will override the default exclusion list.
-I include optional. By default the test will include the
JavaScript tests appropriate for the branch. include is a
list of either individual tests, manifest files or
sub-directories which will override the default inclusion
list.
-c optional. By default the test will exclude tests
which crash on this branch, test type, build type and
operating system. -c will include tests which crash.
Typically this should only be used in combination with -R.
This has no effect on shell based tests which execute crash
tests regardless.
-t optional. By default the test will exclude tests
which time out on this branch, test type, build type and
operating system. -t will include tests which timeout.
-d datafiles optional. one or more filenames of files containing
environment variable definitions to be included.
@ -91,12 +110,16 @@ EOF
exit 2
}
while getopts $options optname ;
while getopts "b:s:T:d:X:I:ct" optname
do
case $optname in
b) branch=$OPTARG;;
s) sourcepath=$OPTARG;;
T) buildtype=$OPTARG;;
X) exclude=$OPTARG;;
I) include=$OPTARG;;
C) crashes=1;;
T) timeouts=1;;
d) datafiles=$OPTARG;;
esac
done
@ -108,42 +131,134 @@ if [[ -n "$datafiles" ]]; then
done
fi
dumpvars branch sourcepath buildtype exclude include crashes timeouts datafiles | sed "s|^|arguments: |"
if [[ -z "$branch" || -z "$sourcepath" || -z "$buildtype" ]]; then
usage
fi
pushd $TEST_JSDIR
rm -f finished-$branch-shell-$buildtype
. config.sh
executable="$sourcepath/$JS_OBJDIR/js$EXE_EXT"
case "$branch" in
1.8.0)
included="ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6 e4x"
if ! make failures.txt; then
error "during make failures.txt" $LINENO
fi
#includetests=`mktemp includetests.XXXXX`
includetests="included-$branch-shell-$buildtype.tests"
rm -f $includetests
touch $includetests
if [[ -z "$include" ]]; then
# by default include tests appropriate for the branch
include="e4x ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6"
case "$branch" in
1.8.0)
;;
1.8.1)
include="$include js1_7"
;;
1.9.0)
include="$include js1_7 js1_8"
;;
esac
fi
for i in $include; do
if [[ -f "$i" ]]; then
echo "# including $i" >> $includetests
if echo $i | grep -q '\.js$'; then
echo $i >> $includetests
else
cat $i >> $includetests
fi
elif [[ -d "$i" ]]; then
find $i -name '*.js' -print | egrep -v '(shell|browser|template|jsref|userhook.*|\.#.*)\.js' | sed 's/^\.\///' | sort >> $includetests
fi
done
#excludetests=`mktemp excludetests.XXXXX`
excludetests="excluded-$branch-shell-$buildtype.tests"
rm -f $excludetests
touch $excludetests
if [[ -z "$exclude" ]]; then
exclude="spidermonkey-n-$branch.tests performance-$branch.tests"
fi
for e in $exclude; do
if [[ -f "$e" ]]; then
echo "# excluding $e" >> $excludetests
if echo $e | grep -q '\.js$'; then
echo $e >> $excludetests
else
cat $e >> $excludetests
fi
elif [[ -d "$e" ]]; then
find $e -name '*.js' -print | egrep -v '(shell|browser|template|userhook.*|\.#.*).js' | sed 's/^\.\///' | sort >> $excludetests
fi
done
case "$OSID" in
win32)
arch='.*'
kernel='.*'
;;
1.8.1)
included="ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6 js1_7 e4x"
linux)
arch="`uname -p`"
kernel="`uname -r | sed 's|\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[-.0-9]*\.\([a-zA-Z0-9]*\)|\1.\2.\3.*\4|'`"
;;
1.9.0)
included="ecma ecma_2 ecma_3 js1_1 js1_2 js1_3 js1_4 js1_5 js1_6 js1_7 js1_8 e4x"
mac)
arch="`uname -p`"
kernel='[^,]*'
;;
*)
error "$product-$branch-$buildtype: $OSID not supported" $LINENO
;;
esac
TEST_HTML_LOG="/dev/null"
if [[ -z "$timeouts" ]]; then
echo "# exclude tests that time out" >> $excludetests
egrep "TEST_BRANCH=([^,]*$branch[^,]*|[.][*]), TEST_RESULT=FAILED, TEST_BUILDTYPE=([^,]*$buildtype[^,]*|[.][*]), TEST_TYPE=([^,]*shell[^,]*|[.][*]), TEST_OS=([^,]*$OSID[^,]*|[.][*]), .*, TEST_PROCESSORTYPE=([^,]*$arch[^,]*|[.][*]), TEST_KERNEL=([^,]*$kernel[^,]*|[.][*]), .*, TEST_DESCRIPTION=.*EXIT STATUS: TIMED OUT" \
failures.txt | sed 's/TEST_ID=\([^,]*\),.*/\1/' | sort | uniq >> $excludetests
fi
# clock skew causes failures. clean first
make clean
make
if [[ -z "$crashes" ]]; then
echo "# exclude tests that crash" >> $excludetests
pattern="TEST_BRANCH=([^,]*$branch[^,]*|[.][*]), TEST_RESULT=FAILED, TEST_BUILDTYPE=([^,]*$buildtype[^,]*|[.][*]), TEST_TYPE=([^,]*shell[^,]*|[.][*]), TEST_OS=([^,]*$OSID[^,]*|[.][*]), .*, TEST_PROCESSORTYPE=([^,]*$arch[^,]*|[.][*]), TEST_KERNEL=([^,]*$kernel[^,]*|[.][*]), .*, TEST_DESCRIPTION=.*"
case "$buildtype" in
opt)
pattern="${pattern}EXIT STATUS: CRASHED"
;;
debug)
pattern="${pattern}(EXIT STATUS: CRASHED|Assertion failure:)"
;;
esac
egrep "$pattern" failures.txt | sed 's/TEST_ID=\([^,]*\),.*/\1/' | sort | uniq >> $excludetests
time perl jsDriver.pl \
-l $included \
-L excluded-n.tests \
-s $executable -e sm$buildtype \
fi
cat $includetests | sed 's|^|include: |'
cat $excludetests | sed 's|^|exclude: |'
if ! time perl jsDriver.pl \
-l $includetests \
-L $excludetests \
-s $executable \
-e sm$buildtype \
-o '-S 524288' \
-R \
-T $TEST_JSSHELL_TIMEOUT \
-f $TEST_HTML_LOG \
-Q
-f /dev/null \
-Q; then
error "$product-$branch-$buildtype-$OSID: jsDriver.pl" $LINENO
fi
popd

Просмотреть файл

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
@ -116,4 +116,4 @@ case "$product" in
;;
esac
$testscript -d "$datafiles"
$testscript -d "$datafiles"

Просмотреть файл

@ -43,36 +43,63 @@
var gCheckInterval = 1000;
var gCurrentTestId;
var gReport;
var gCurrentTestStart;
var gCurrentTestStop;
var gCurrentTestValid;
var gPageStart;
var gPageStop;
function userOnStart()
{
dlog('userOnStart');
cdump('JavaScriptTest: Begin Run');
registerDialogCloser();
}
function userOnBeforePage()
{
dlog('userOnBeforePage');
gCurrentTestId = /test=(.*);language/.exec(gSpider.mCurrentUrl.mUrl)[1];
cdump('JavaScriptTest: Begin Test ' + gCurrentTestId);
cdump('JavaScriptTest: Begin Execution ' + gCurrentTestId);
gPageStart = new Date();
try
{
gCurrentTestId = /test=(.*);language/.exec(gSpider.mCurrentUrl.mUrl)[1];
gCurrentTestValid = true;
cdump('JavaScriptTest: Begin Test ' + gCurrentTestId);
gCurrentTestStart = new Date();
}
catch(ex)
{
cdump('userOnBeforePage: ' + ex);
gCurrentTestValid = false;
gPageCompleted = true;
}
}
function userOnAfterPage()
{
dlog('userOnAfterPage');
cdump('JavaScriptTest: End Execution ' + gCurrentTestId);
gPageStop = new Date();
cdump(gSpider.mCurrentUrl.mUrl + ': PAGE STATUS: NORMAL (' + ((gPageStop - gPageStart)/1000).toFixed(0) + ' seconds)');
checkTestCompleted();
}
function userOnStop()
{
// close any pending dialogs
cdump('JavaScriptTest: End Test ' + gCurrentTestId);
cdump('JavaScriptTest: End Run');
closeDialog();
unregisterDialogCloser();
}
function userOnPageTimeout()
{
gPageStop = new Date();
cdump(gSpider.mCurrentUrl.mUrl + ': PAGE STATUS: TIMED OUT (' + ((gPageStop - gPageStart)/1000).toFixed(0) + ' seconds)');
cdump('JavaScriptTest: End Test ' + gCurrentTestId);
}
function checkTestCompleted()
{
dlog('checkTestCompleted()');
@ -82,33 +109,39 @@ function checkTestCompleted()
{
win = win.wrappedJSObject;
}
if (win.gPageCompleted)
if (!gCurrentTestValid)
{
dlog('Page Completed');
cdump('JavaScriptTest: Begin Summary ' + gCurrentTestId);
gPageCompleted = true;
}
else if (win.gPageCompleted)
{
gCurrentTestStop = new Date();
// gc to flush out issues quickly
collectGarbage();
dlog('Page Completed');
var gTestcases = win.gTestcases;
if (typeof gTestcases == 'undefined')
{
cdump('JavaScriptTest: ' + gCurrentTestId +
' gTestcases array not defined. Possible test failure.');
throw 'gTestcases array not defined. Possible test failure.';
}
else if (gTestcases.length == 0)
{
cdump('JavaScriptTest: ' + gCurrentTestId +
' gTestcases array is empty. Tests not run.');
new win.TestCase(win.gTestFile, win.summary, 'Unknown', 'gTestcases array is empty. Tests not run..');
}
else
{
}
cdump('JavaScriptTest: End Summary ' + gCurrentTestId);
cdump('JavaScriptTest: ' + gCurrentTestId + ' Elapsed time ' + ((gCurrentTestStop - gCurrentTestStart)/1000).toFixed(2) + ' seconds');
cdump('JavaScriptTest: End Test ' + gCurrentTestId);
// added in Spider 0.0.1.8
// gc to flush out issues quickly
collectGarbage();
gPageCompleted = true;
}
else
{