Index: client/testing/unittest/unittest_vm.dart |
diff --git a/client/testing/unittest/unittest_vm.dart b/client/testing/unittest/unittest_vm.dart |
index 55fbd440efd6676be69e769169a70079e418aee1..9b185380255b51270c0d65845e2fb226e7e4e39f 100644 |
--- a/client/testing/unittest/unittest_vm.dart |
+++ b/client/testing/unittest/unittest_vm.dart |
@@ -36,11 +36,18 @@ _platformCompleteTests(int testsPassed, int testsFailed, int testsErrors) { |
// Show the summary. |
print(''); |
+ var success = false; |
if (testsPassed == 0 && testsFailed == 0 && testsErrors == 0) { |
print('No tests found.'); |
+ // This is considered a failure too: if this happens you probably have a |
+ // bug in your unit tests. |
} else if (testsFailed == 0 && testsErrors == 0) { |
print('All $testsPassed tests passed.'); |
+ success = true; |
} else { |
print('$testsPassed PASSED, $testsFailed FAILED, $testsErrors ERRORS'); |
} |
+ |
+ // A non-zero exit code is used by the test infrastructure to detect failure. |
+ if (!success) exit(1); |
} |