From c8003673857919d2283e16c829325c9f14e10dfe Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 15 Sep 1999 22:23:35 +0000 Subject: * Cleanup the test suite. --- tests/ChangeLog | 25 ++++++++++++++++++ tests/README | 4 +-- tests/run_make_tests.pl | 52 +++++++++++++++++++------------------- tests/scripts/features/parallelism | 6 ++--- tests/scripts/features/reinvoke | 3 ++- tests/test_driver.pl | 10 +++++++- 6 files changed, 67 insertions(+), 33 deletions(-) create mode 100644 tests/ChangeLog (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog new file mode 100644 index 0000000..ee4b4a3 --- /dev/null +++ b/tests/ChangeLog @@ -0,0 +1,25 @@ +1999-09-15 Paul D. Smith + + * scripts/features/parallelism: The second test output could + change depending on how fast some scripts completed; use "sleep" + to force the order we want. + + * test_driver.pl (toplevel): A bug in Perl 5.000 to Perl 5.004 + means that "%ENV = ();" doesn't do the right thing. This worked + in Perl 4 and was fixed in Perl 5.004_01, but use a loop to delete + the environment rather than require specific versions. + + * run_make_tests.pl (set_more_defaults): Don't use Perl 5 s/// + modifier "s", so the tests will run with Perl 4. + (set_more_defaults): Set $pure_log to empty if there's no -logfile + option in PURIFYOPTIONS. + (setup_for_test): Don't remove any logs unless $pure_log is set. + +1999-09-15 Eli Zaretskii + + * scripts/features/reinvoke: Put the SHELL definition in the right + test makefile. + +1999-09-15 Paul D. Smith + + ChangeLog file for the test suite created. diff --git a/tests/README b/tests/README index a0e800c..12fa698 100644 --- a/tests/README +++ b/tests/README @@ -8,8 +8,8 @@ infrastructure changes I've added a number of new tests. Rob Tulloh has contributed changes to get the suite running on NT. -Eli Zaretski and Esa A E Peuha have contributed -changes to the get the suite running on DJGPP/DOS. +Eli Zaretskii and Esa A E Peuha have contributed +changes to get the suite running on DJGPP/DOS. This package has a number of problems which preclude me from distributing it with make as a default "make check" test suite. The diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl index 56902ca..484dbe1 100755 --- a/tests/run_make_tests.pl +++ b/tests/run_make_tests.pl @@ -101,18 +101,16 @@ sub print_help } sub get_this_pwd { - if ($vos) - { - $delete_command = "delete_file"; - $__pwd = `++(current_dir)`; - } - else - { - $delete_command = "rm"; - chop ($__pwd = `pwd`); - } - - return $__pwd; + if ($vos) { + $delete_command = "delete_file"; + $__pwd = `++(current_dir)`; + } + else { + $delete_command = "rm"; + chop ($__pwd = `pwd`); + } + + return $__pwd; } sub set_defaults @@ -141,8 +139,8 @@ sub set_more_defaults $string = `$make_path -v -f /dev/null 2> /dev/null`; - $string =~ s/[,\n].*/\n/s; - $testee_version = $string; + $string =~ /^(GNU Make [^,\n]*)/; + $testee_version = "$1\n"; $string = `sh -c "$make_path -f /dev/null 2>&1"`; if ($string =~ /(.*): \*\*\* No targets\. Stop\./) { @@ -172,7 +170,8 @@ sub set_more_defaults # Get Purify log info--if any. - ($pure_log = $ENV{PURIFYOPTIONS}) =~ s,.*-logfile=([^ ]+) .*,\1,; + $ENV{PURIFYOPTIONS} =~ /.*-logfile=([^ ]+)/; + $pure_log = $1 || ''; $pure_log =~ s/%v/$make_name/; $purify_errors = 0; @@ -187,17 +186,18 @@ sub set_more_defaults sub setup_for_test { - $makefile = &get_tmpfile; - if (-f $makefile) - { - unlink $makefile; - } - - # Get rid of any Purify logs. - ($pure_testname = $testname) =~ tr,/,_,; - $pure_testname = "$pure_log.$pure_testname"; - system("rm -f $pure_testname*"); - print("Purify testfiles are: $pure_testname*\n") if $debug; + $makefile = &get_tmpfile; + if (-f $makefile) { + unlink $makefile; + } + + # Get rid of any Purify logs. + if ($pure_log) { + ($pure_testname = $testname) =~ tr,/,_,; + $pure_testname = "$pure_log.$pure_testname"; + system("rm -f $pure_testname*"); + print("Purify testfiles are: $pure_testname*\n") if $debug; + } } exit !&toplevel; diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism index 17e800c..323eb5c 100644 --- a/tests/scripts/features/parallelism +++ b/tests/scripts/features/parallelism @@ -60,15 +60,15 @@ all: 1 2 3; @echo success -include 1.inc 2.inc 3.inc - 1.inc: ; @sleep 1; echo 1; echo "1: ; @echo $@ has been included" > $@ +1.inc: ; @sleep 1; echo 1; echo "1: ; @sleep 2; echo $@ has been included" > $@ 2.inc: ; @sleep 2; echo 2; echo "2: ; @echo $@ has been included" > $@ -3.inc: ; @echo 3; echo "3: ; @echo $@ has been included" > $@ +3.inc: ; @echo 3; echo "3: ; @sleep 1; echo $@ has been included" > $@ EOF close(MAKEFILE); &run_make_with_options("$makefile2", "-j 4", &get_logfile); -$answer = "3\n1\n2\n1.inc has been included\n2.inc has been included\n3.inc has been included\nsuccess\n"; +$answer = "3\n1\n2\n2.inc has been included\n3.inc has been included\n1.inc has been included\nsuccess\n"; &compare_output($answer, &get_logfile(1)); unlink('1.inc', '2.inc', '3.inc'); diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke index 1047d0e..99fb466 100644 --- a/tests/scripts/features/reinvoke +++ b/tests/scripts/features/reinvoke @@ -13,7 +13,6 @@ $makefile_orig = &get_tmpfile; open(MAKEFILE,"> $makefile"); print MAKEFILE < $makefile3"); print MAKEFILE <<'EOM'; +SHELL = /bin/sh + all: ; @echo hello a : b ; touch $@ diff --git a/tests/test_driver.pl b/tests/test_driver.pl index 914e0c6..7dd7fda 100644 --- a/tests/test_driver.pl +++ b/tests/test_driver.pl @@ -36,7 +36,15 @@ sub toplevel # Replace the environment with the new one # %origENV = %ENV; - %ENV = (); + + # We used to say "%ENV = ();" but this doesn't work in Perl 5.000 + # through Perl 5.004. It was fixed in Perl 5.004_01, but we don't + # want to require that here, so just delete each one individually. + + foreach $v (keys %ENV) { + delete $ENV{$v}; + } + %ENV = %makeENV; $| = 1; # unbuffered output -- cgit v1.2.3