mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 443090 - Unify unittest failures (reftest part) p=ted.mielczarek, r=dbaron
This commit is contained in:
parent
8bf816cfd2
commit
3cfe0e4c1a
@ -56,7 +56,7 @@ while (<>) {
|
||||
next unless /REFTEST/;
|
||||
chomp;
|
||||
chop if /\r$/;
|
||||
s,(PASS|FAIL)([^:]*):( \(!=\))? (.*),\1\2:\3 <a href="\4">\4</a>,;
|
||||
s,(TEST-)([^\|]*) \| ([^\|]*) \|(.*),\1\2: <a href="\3">\3</a>\4,;
|
||||
s,(IMAGE[^:]*): (data:.*),<a href="\2">\1</a>,;
|
||||
print;
|
||||
print "\n";
|
||||
|
@ -141,17 +141,18 @@ function process_log(contents) {
|
||||
if (!match)
|
||||
continue;
|
||||
line = match[1];
|
||||
match = line.match(/^(PASS|UNEXPECTED PASS|KNOWN FAIL|UNEXPECTED FAIL)( \(RESULT EXPECTED TO BE RANDOM\)| \(SKIP\)|): (.*)/);
|
||||
match = line.match(/^(TEST-PASS|TEST-UNEXPECTED-PASS|TEST-KNOWN-FAIL|TEST-UNEXPECTED-FAIL)(\(EXPECTED RANDOM\)|) \| ([^\|]+) \|(.*)/);
|
||||
if (match) {
|
||||
var state = match[1];
|
||||
var extra = match[2];
|
||||
var random = match[2];
|
||||
var url = match[3];
|
||||
var extra = match[4];
|
||||
gTestItems.push(
|
||||
{
|
||||
pass: !state.match(/FAIL$/),
|
||||
// only one of the following three should ever be true
|
||||
unexpected: !!state.match(/^UNEXPECTED/),
|
||||
random: (extra == " (RESULT EXPECTED TO BE RANDOM)"),
|
||||
unexpected: !!state.match(/^TEST-UNEXPECTED/),
|
||||
random: (random == "(EXPECTED RANDOM)"),
|
||||
skip: (extra == " (SKIP)"),
|
||||
url: url,
|
||||
images: []
|
||||
|
@ -98,15 +98,15 @@ while (<>) {
|
||||
s/^REFTEST *//;
|
||||
|
||||
my $randomresult = 0;
|
||||
if (/RESULT EXPECTED TO BE RANDOM/) {
|
||||
s/\(RESULT EXPECTED TO BE RANDOM\) //;
|
||||
if (/EXPECTED RANDOM/) {
|
||||
s/\(EXPECTED RANDOM\)//;
|
||||
$randomresult = 1;
|
||||
}
|
||||
|
||||
if (/^PASS(.*)$/) {
|
||||
if (/^TEST-PASS \| (.*)$/) {
|
||||
my $class = $randomresult ? "PASSRANDOM" : "PASS";
|
||||
print '<tr><td class="' . $class . '">' . do_html($1) . "</td></tr>\n";
|
||||
} elsif (/^UNEXPECTED (....): (.*)$/) {
|
||||
} elsif (/^TEST-UNEXPECTED-(....) \| (.*)$/) {
|
||||
if ($randomresult) {
|
||||
die "Error on line $l: UNEXPECTED with test marked random?!";
|
||||
}
|
||||
@ -133,7 +133,7 @@ while (<>) {
|
||||
}
|
||||
|
||||
print "</td></tr>\n";
|
||||
} elsif (/^KNOWN FAIL(.*$)/) {
|
||||
} elsif (/^TEST-KNOWN-FAIL \| (.*$)/) {
|
||||
my $class = $randomresult ? "XFAILRANDOM" : "XFAIL";
|
||||
print '<tr><td class="' . $class . '">' . do_html($1) . "</td></tr>\n";
|
||||
} else {
|
||||
|
@ -110,7 +110,7 @@ function OnRefTestLoad()
|
||||
StartCurrentTest();
|
||||
} catch (ex) {
|
||||
//gBrowser.loadURI('data:text/plain,' + ex);
|
||||
dump("REFTEST EXCEPTION: " + ex + "\n");
|
||||
dump("REFTEST TEST-FAIL | | EXCEPTION: " + ex + "\n");
|
||||
DoneTests();
|
||||
}
|
||||
}
|
||||
@ -281,7 +281,7 @@ function StartCurrentTest()
|
||||
{
|
||||
// make sure we don't run tests that are expected to kill the browser
|
||||
while (gURLs.length > 0 && gURLs[0].expected == EXPECTED_DEATH) {
|
||||
dump("REFTEST KNOWN FAIL (SKIP): " + gURLs[0].url1.spec + "\n");
|
||||
dump("REFTEST TEST-KNOWN-FAIL | " + gURLs[0].url1.spec + " | (SKIP)\n");
|
||||
gURLs.shift();
|
||||
}
|
||||
|
||||
@ -396,7 +396,7 @@ function DocumentLoaded()
|
||||
clearTimeout(gFailureTimeout);
|
||||
|
||||
if (gURLs[0].expected == EXPECTED_LOAD) {
|
||||
dump("REFTEST PASS (LOAD ONLY): " + gURLs[0].prettyPath + "\n");
|
||||
dump("REFTEST TEST-PASS | " + gURLs[0].prettyPath + "| (LOAD ONLY)\n");
|
||||
gURLs.shift();
|
||||
StartCurrentTest();
|
||||
return;
|
||||
@ -449,19 +449,19 @@ function DocumentLoaded()
|
||||
var expected = gURLs[0].expected;
|
||||
|
||||
var outputs = {};
|
||||
const randomMsg = " (RESULT EXPECTED TO BE RANDOM)";
|
||||
outputs[EXPECTED_PASS] = {true: "PASS",
|
||||
false: "UNEXPECTED FAIL"};
|
||||
outputs[EXPECTED_FAIL] = {true: "UNEXPECTED PASS",
|
||||
false: "KNOWN FAIL"};
|
||||
outputs[EXPECTED_RANDOM] = {true: "PASS" + randomMsg,
|
||||
false: "KNOWN FAIL" + randomMsg};
|
||||
const randomMsg = "(EXPECTED RANDOM)";
|
||||
outputs[EXPECTED_PASS] = {true: "TEST-PASS",
|
||||
false: "TEST-UNEXPECTED-FAIL"};
|
||||
outputs[EXPECTED_FAIL] = {true: "TEST-UNEXPECTED-PASS",
|
||||
false: "TEST-KNOWN-FAIL"};
|
||||
outputs[EXPECTED_RANDOM] = {true: "TEST-PASS" + randomMsg,
|
||||
false: "TEST-KNOWN-FAIL" + randomMsg};
|
||||
|
||||
var result = "REFTEST " + outputs[expected][test_passed] + ": ";
|
||||
var result = "REFTEST " + outputs[expected][test_passed] + " | ";
|
||||
result += gURLs[0].prettyPath + " | "; // the URL being tested
|
||||
if (!gURLs[0].equal) {
|
||||
result += "(!=) ";
|
||||
}
|
||||
result += gURLs[0].prettyPath; // the URL being tested
|
||||
dump(result + "\n");
|
||||
if (!test_passed && expected == EXPECTED_PASS ||
|
||||
test_passed && expected == EXPECTED_FAIL) {
|
||||
@ -484,8 +484,8 @@ function DocumentLoaded()
|
||||
|
||||
function LoadFailed()
|
||||
{
|
||||
dump("REFTEST UNEXPECTED FAIL (LOADING): " +
|
||||
gURLs[0]["url" + gState].spec + "\n");
|
||||
dump("REFTEST TEST-UNEXPECTED-FAIL | " +
|
||||
gURLs[0]["url" + gState].spec + "| Failed to load\n");
|
||||
gURLs.shift();
|
||||
StartCurrentTest();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user