From c637af71d9398a269c467a132109e0ef853806d4 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 27 Mar 2000 06:54:37 +0000 Subject: * A large number of fixes/enhancements. See the ChangeLog. * Added a new version of the German translation file. --- tests/ChangeLog | 20 +++++++ tests/scripts/features/double_colon | 9 +++ tests/scripts/features/reinvoke | 3 +- tests/scripts/functions/call | 18 +++++- tests/scripts/options/dash-k | 107 ++++++++++++++++++++++-------------- 5 files changed, 113 insertions(+), 44 deletions(-) (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index 4d859ad..55e56f8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,8 +1,28 @@ +2000-03-27 Paul D. Smith + + * scripts/features/reinvoke: Make more robust by touching "b" + first, to ensure it's not newer than "a". + Reported by Marco Franzen . + + * scripts/functions/call: Whoops. The fix to PR/1527 caused + recursive invocations of $(call ...) to break. I can't come up + with any way to get both working at the same time, so I backed out + the fix to 1527 and added a test case for recursive calls. + + * scripts/features/double_colon: Test that circular dependencies + in double-colon rule sets are detected correctly (PR/1671). + 2000-03-26 Paul D. Smith * scripts/targets/INTERMEDIATE: Test that make doesn't remove .INTERMEDIATE files when given on the command line (PR/1669). +2000-03-08 Paul D. Smith + + * scripts/options/dash-k: Add a test for error detection by + multiple targets depending on the same prerequisite with -k. + For PR/1634. + 2000-02-07 Paul D. Smith * scripts/features/escape: Add a test for backslash-escaped spaces diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon index 75060c5..e0e53f0 100644 --- a/tests/scripts/features/double_colon +++ b/tests/scripts/features/double_colon @@ -36,6 +36,9 @@ two: ; @echo two f1.h f2.h: ; @echo $@ +d :: ; @echo ok +d :: d ; @echo oops + EOF close(MAKEFILE); @@ -95,6 +98,12 @@ $answer = "f2.h\nfoo SECOND\n"; $answer = "f2.h\nfoo SECOND\n"; &compare_output($answer, &get_logfile(1)); +# TEST 8: Test circular dependency check; PR/1671 + +&run_make_with_options($makefile, "d", &get_logfile, 0); +$answer = "ok\n$make_name: Circular d <- d dependency dropped.\noops\n"; +&compare_output($answer, &get_logfile(1)); + # TEST 8: I don't grok why this is different than the above, but it is... # # Hmm... further testing indicates this might be timing-dependent? diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke index 713580c..dacfd33 100644 --- a/tests/scripts/features/reinvoke +++ b/tests/scripts/features/reinvoke @@ -65,7 +65,8 @@ EOM close(MAKEFILE); -&touch('a','b'); +&touch('b'); +&touch('a'); sleep(2); &touch('c'); diff --git a/tests/scripts/functions/call b/tests/scripts/functions/call index 8b6aa36..bdb8e89 100644 --- a/tests/scripts/functions/call +++ b/tests/scripts/functions/call @@ -26,23 +26,35 @@ my-notdir = $(call notdir,$(1)) my-foreach = $(foreach $(1),$(2),$(3)) my-if = $(if $(1),$(2),$(3)) +# Test recursive invocations of call with different arguments +# +one = $(1) $(2) $(3) +two = $(call one,$(1),foo,$(2)) + + all: ; @echo '$(call reverse,bar,foo)'; \ echo '$(call map,origin,MAKE reverse map)'; \ echo '$(call my-notdir,a/b c/d e/f)'; \ echo '$(call my-foreach)'; \ echo '$(call my-foreach,a,,,)'; \ - echo '$(call my-foreach,a,x y z,$(a)$(a))'; \ echo '$(call my-if,a,b,c)'; \ - echo '$(call my-if,,$(warning don't print this),ok)' + echo '$(call two,bar,baz)' EOMAKE +# These won't work until/unless PR/1527 is resolved. +# echo '$(call my-foreach,a,x y z,$(a)$(a))'; \ +# echo '$(call my-if,,$(warning don't print this),ok)' +# +# $answer = "xx yy zz\nok\n"; + # END of Contents of MAKEFILE close(MAKEFILE); &run_make_with_options($makefile, "", &get_logfile); -$answer = "foo bar\ndefault file file\nb d f\n\n\nxx yy zz\nb\nok\n"; +$answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\n"; + &compare_output($answer, &get_logfile(1)); 1; diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k index a5baaf7..fe5689e 100644 --- a/tests/scripts/options/dash-k +++ b/tests/scripts/options/dash-k @@ -1,36 +1,37 @@ -$description = "The following test creates a makefile to test the -k option.\n" - ."Normally, make gives up immediately if an error happens \n" - ."that make has not been told to ignore. However, if the -k\n" - ."option is specified, make continues to consider the other\n" - ."dependencies of the pending targets."; - -$details = "The makefile created in this test is a simulation of building \n" - ."a small product. However, the trick to this one is that one \n" - ."of the dependencies of the main target does not exist. \n" - ."Without the -k option, make would fail immediately and not \n" - ."build any part of the target. What we are looking for here, \n" - ."is that make builds the rest of the dependencies even though \n" - ."it knows that at the end it will fail to rebuild the main target."; +# -*-perl-*- + +$description = "Test the make -k (don't stop on error) option.\n"; + +$details = "\ +The makefile created in this test is a simulation of building +a small product. However, the trick to this one is that one +of the dependencies of the main target does not exist. +Without the -k option, make would fail immediately and not +build any part of the target. What we are looking for here, +is that make builds the rest of the dependencies even though +it knows that at the end it will fail to rebuild the main target."; open(MAKEFILE,"> $makefile"); # The Contents of the MAKEFILE ... -print MAKEFILE "VPATH = $workdir\n"; -print MAKEFILE "edit: main.o kbd.o commands.o display.o \n"; -print MAKEFILE "\t\@echo cc -o edit main.o kbd.o commands.o display.o \n"; +print MAKEFILE < $makefile2"); +print MAKEFILE <<'EOF'; +.SUFFIXES: + +all: exe1 exe2; @echo making $@ + +exe1 exe2: lib; @echo cp $^ $@ + +lib: foo.o; @echo cp $^ $@ + +foo.o: ; exit 1 +EOF + +close(MAKEFILE); + +&run_make_with_options($makefile2, "-k", &get_logfile, $error_code); + +$answer = "exit 1 +$make_name: *** [foo.o] Error 1 +$make_name: Target `all' not remade because of errors.\n"; + +&compare_output($answer, &get_logfile(1)); 1; -- cgit v1.2.3