Reviewers: Kasper Lund, Description: Fix bug that meant that dependent tests were never reported as failing (though they could still crash). (Cache the result of the test in the output object, not in the test object which is reused from the prerequisite to the dependent.)
Please review this at http://codereview.chromium.org/321001 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M test/cctest/cctest.status M test/cctest/test-serialize.cc M tools/test.py Index: test/cctest/cctest.status =================================================================== --- test/cctest/cctest.status (revision 3112) +++ test/cctest/cctest.status (working copy) @@ -33,7 +33,18 @@ # BUG(382): Weird test. Can't guarantee that it never times out. test-api/ApplyInterruption: PASS || TIMEOUT +# This is about to go away anyway. +test-serialize/Deserialize: PASS || FAIL +test-serialize/DeserializeAndRunScript: PASS || FAIL +test-serialize/DeserializeNatives: PASS || FAIL +test-serialize/DeserializeExtensions: PASS || FAIL +# These tests always fail. They are here to test test.py. If +# they don't fail then test.py has failed. +test-serialize/TestThatAlwaysFails: FAIL +test-serialize/DependentTestThatAlwaysFails: FAIL + + [ $arch == arm ] # BUG(113): Test seems flaky on ARM. Index: test/cctest/test-serialize.cc =================================================================== --- test/cctest/test-serialize.cc (revision 3112) +++ test/cctest/test-serialize.cc (working copy) @@ -286,3 +286,20 @@ v8::Local<v8::Value> value = script->Run(); CHECK(value->IsUndefined()); } + + +extern "C" void V8_Fatal(const char* file, int line, const char* format, ...); + + +TEST(TestThatAlwaysSucceeds) { +} + + +TEST(TestThatAlwaysFails) { + V8_Fatal(__FILE__, __LINE__, "Artificial failure"); +} + + +DEPENDENT_TEST(DependentTestThatAlwaysFails, TestThatAlwaysSucceeds) { + V8_Fatal(__FILE__, __LINE__, "Artificial failure2"); +} Index: tools/test.py =================================================================== --- tools/test.py (revision 3112) +++ tools/test.py (working copy) @@ -326,6 +326,7 @@ self.timed_out = timed_out self.stdout = stdout self.stderr = stderr + self.failed = None class TestCase(object): @@ -333,7 +334,6 @@ def __init__(self, context, path): self.path = path self.context = context - self.failed = None self.duration = None def IsNegative(self): @@ -343,9 +343,9 @@ return cmp(other.duration, self.duration) def DidFail(self, output): - if self.failed is None: - self.failed = self.IsFailureOutput(output) - return self.failed + if output.failed is None: + output.failed = self.IsFailureOutput(output) + return output.failed def IsFailureOutput(self, output): return output.exit_code != 0 --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
