summarize test results

This commit is contained in:
shaver@mozilla.org 2008-07-17 01:58:34 -07:00
parent 08b285515b
commit ffdbf9b5cd

View File

@ -1,7 +1,12 @@
var fails = [], passes=[];
function test(desc, actual, expected)
{
if (expected == actual)
if (expected == actual) {
passes.push(desc);
return print(desc, ": passed");
}
fails.push(desc);
print(desc, ": FAILED: expected", typeof(expected), "(", expected, ") != actual",
typeof(actual), "(", actual, ")");
}
@ -234,8 +239,13 @@ function call()
q3 += glob_f1();
q4 += o.f();
q5 += glob_f2();
}
}
var ret = [q1, q2, q3, q4, q5];
return ret;
}
test("call", call(), "100,100,100,100,100");
if (passes.length)
print("pass:", passes.join(","));
if (fails.length)
print("FAIL:", fails.join(","));