From 08c8105c5468ff743d2f2ff2fdf3b77a6313b53e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 16 May 2004 19:16:52 +0000 Subject: Various enhancements - OS/2 Patches - OpenVMS updates - Sanitize the handling of -include/sinclude with and without -k - Fix the setting of $< for order-only rules. --- tests/test_driver.pl | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) (limited to 'tests/test_driver.pl') diff --git a/tests/test_driver.pl b/tests/test_driver.pl index 0ddb884..0bca669 100644 --- a/tests/test_driver.pl +++ b/tests/test_driver.pl @@ -28,6 +28,10 @@ $tests_run = 0; # The number of tests in this category that have passed $tests_passed = 0; + +# Yeesh. This whole test environment is such a hack! +$test_passed = 1; + sub toplevel { # Get a clean environment @@ -376,7 +380,7 @@ sub run_each_test foreach $testname (sort @TESTS) { ++$categories_run; - $passed = 1; # reset by test on failure + $suite_passed = 1; # reset by test on failure $num_of_logfiles = 0; $num_of_tmpfiles = 0; $description = ""; @@ -423,7 +427,7 @@ sub run_each_test # How did it go? if (!defined($code)) { - $passed = 0; + $suite_passed = 0; if (length ($@)) { warn "\n*** Test died ($testname): $@\n"; @@ -434,14 +438,14 @@ sub run_each_test } } elsif ($code == -1) { - $passed = 0; + $suite_passed = 0; } elsif ($code != 1 && $code != -1) { - $passed = 0; + $suite_passed = 0; warn "\n*** Test returned $code\n"; } - if ($passed) { + if ($suite_passed) { ++$categories_passed; $status = "ok ($tests_passed passed)"; for ($i = $num_of_tmpfiles; $i; $i--) @@ -608,10 +612,7 @@ sub compare_output local($answer,$logfile) = @_; local($slurp); - if ($debug) - { - print "Comparing Output ........ "; - } + print "Comparing Output ........ " if $debug; $slurp = &read_file_into_string ($logfile); @@ -622,34 +623,28 @@ sub compare_output ++$tests_run; - if ($slurp eq $answer) + if ($slurp eq $answer && $test_passed) { - if ($debug) - { - print "ok\n"; - } + print "ok\n" if $debug; ++$tests_passed; return 1; } - else - { - if ($debug) - { - print "DIFFERENT OUTPUT\n"; - } - $passed = 0; + + if ($slurp ne $answer) { + print "DIFFERENT OUTPUT\n" if $debug; + &create_file (&get_basefile, $answer); - if ($debug) - { - print "\nCreating Difference File ...\n"; - } + print "\nCreating Difference File ...\n" if $debug; + # Create the difference file local($command) = "diff -c " . &get_basefile . " " . $logfile; &run_command_with_output(&get_difffile,$command); - return 0; } + + $suite_passed = 0; + return 0; } sub read_file_into_string -- cgit v1.2.3