summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2022-12-20 02:06:03 -0500
committerPaul Smith <psmith@gnu.org>2022-12-20 02:07:28 -0500
commitb2c74460237f7609564bc80641acff9cf6cb0f7d (patch)
tree9b1c6b7a96e71a5bd4aec76dfb756eb4226e8bfe /tests
parent89427039c3b8204e7e86a5caa1522a2756872d4f (diff)
downloadmake-git-b2c74460237f7609564bc80641acff9cf6cb0f7d.tar.gz
* tests/test_driver.pl: Remember if something failed and report it
Diffstat (limited to 'tests')
-rw-r--r--tests/test_driver.pl12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index efe4981d..3d9a641b 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -43,6 +43,9 @@ $categories_passed = 0;
$total_tests_run = 0;
# The total number of individual tests that have passed
$total_tests_passed = 0;
+# Set to true if something failed. It could be that tests_run == tests_passed
+# even with failures, if we don't run tests for some reason.
+$some_test_failed = 0;
# The number of tests in this category that have been run
$tests_run = 0;
# The number of tests in this category that have passed
@@ -364,6 +367,11 @@ sub toplevel
print ($categories_failed == 1 ? "y" : "ies");
print " Failed (See .$diffext* files in $workdir dir for details) :-(\n\n";
return 0;
+ } elsif ($some_test_failed) {
+ # Something failed but no tests were marked failed... probably a syntax
+ # error in a test script
+ print "\nSome tests failed (See output for details) :-(\n\n";
+ return 0;
}
print "\n$total_tests_passed Test";
@@ -646,6 +654,7 @@ sub run_all_tests
warn "\n*** Couldn't parse $perl_testname\n";
}
$status = "FAILED ($tests_passed/$tests_run passed)";
+ $some_test_failed = 1;
} elsif ($code == -1) {
# Skipped... not supported
@@ -657,14 +666,17 @@ sub run_all_tests
# the suite forgot to end with "1;".
warn "\n*** Test returned $code\n";
$status = "FAILED ($tests_passed/$tests_run passed)";
+ $some_test_failed = 1;
} elsif ($tests_run == 0) {
# Nothing was done!!
$status = "FAILED (no tests found!)";
+ $some_test_failed = 1;
} elsif ($tests_run > $tests_passed) {
# Lose!
$status = "FAILED ($tests_passed/$tests_run passed)";
+ $some_test_failed = 1;
} else {
# Win!