From 0d366b668244112846554c42045ff1d9956276ed Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 14 Sep 1999 02:03:19 +0000 Subject: * Added the test suite to the main distribution. --- tests/scripts/features/reinvoke | 90 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tests/scripts/features/reinvoke (limited to 'tests/scripts/features/reinvoke') diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke new file mode 100644 index 0000000..1047d0e --- /dev/null +++ b/tests/scripts/features/reinvoke @@ -0,0 +1,90 @@ +# -*-mode: perl-*- + +$description = "Test GNU make's auto-reinvocation feature."; + +$details = "\ +If the makefile or one it includes can be rebuilt then it is, and make +is reinvoked. We create a rule to rebuild the makefile from a temp +file, then touch the temp file to make it newer than the makefile."; + +$makefile2 = &get_tmpfile; +$makefile_orig = &get_tmpfile; + +open(MAKEFILE,"> $makefile"); + +print MAKEFILE < $makefile3"); +print MAKEFILE <<'EOM'; +all: ; @echo hello + +a : b ; touch $@ + +b : c ; [ -f $@ ] || touch $@ + +c: ; touch $@ + +include $(F) +EOM + +close(MAKEFILE); + +&touch('a','b'); +sleep(2); +&touch('c'); + +# First try with the file that's not updated "once removed" from the +# file we're including. + +&run_make_with_options($makefile3, "F=a", &get_logfile, 0); + +$answer = "[ -f b ] || touch b\nhello\n"; +&compare_output($answer,&get_logfile(1)); + +# Now try with the file we're not updating being the actual file we're +# including: this and the previous one test different parts of the code. + +&run_make_with_options($makefile3, "F=b", &get_logfile, 0); + +$answer = "[ -f b ] || touch b\nhello\n"; +&compare_output($answer,&get_logfile(1)); + +unlink('a','b','c'); + +# This tells the test driver that the perl test script executed properly. +1; -- cgit v1.2.3