diff options
Diffstat (limited to 'tests/scripts/features')
-rw-r--r-- | tests/scripts/features/echoing | 9 | ||||
-rw-r--r-- | tests/scripts/features/errors | 25 | ||||
-rw-r--r-- | tests/scripts/features/include | 33 | ||||
-rw-r--r-- | tests/scripts/features/order_only | 11 |
4 files changed, 52 insertions, 26 deletions
diff --git a/tests/scripts/features/echoing b/tests/scripts/features/echoing index ed1e862..2e366cd 100644 --- a/tests/scripts/features/echoing +++ b/tests/scripts/features/echoing @@ -54,13 +54,10 @@ $answer = "echo This makefile did not clean the dir... good\n" # ------- &run_make_with_options($makefile,"clean",&get_logfile,0); -$answer = ""; -&compare_output($answer,&get_logfile(1)); - -if (-f $example) -{ - $test_passed = 0; +if (-f $example) { + $test_passed = 0; } +&compare_output('',&get_logfile(1)); # TEST #3 # ------- diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors index a39064f..253f50f 100644 --- a/tests/scripts/features/errors +++ b/tests/scripts/features/errors @@ -52,6 +52,13 @@ $answer = "$delete_command cleanit\n" &run_make_with_options($makefile,"",&get_logfile); +# If make acted as planned, it should ignore the error from the first +# command in the target and execute the second which deletes the file "foo" +# This file, therefore, should not exist if the test PASSES. +if (-f "foo") { + $test_passed = 0; +} + # The output for this on VOS is too hard to replicate, so we only check it # on unix. if (!$vos) @@ -59,14 +66,6 @@ if (!$vos) &compare_output($answer,&get_logfile(1)); } -# If make acted as planned, it should ignore the error from the first -# command in the target and execute the second which deletes the file "foo" -# This file, therefore, should not exist if the test PASSES. -if (-f "foo") -{ - $test_passed = 0; -} - &touch("foo"); @@ -80,14 +79,12 @@ $answer = "$delete_command cleanit\n" &run_make_with_options($makefile,"clean2 -i",&get_logfile); -if (!$vos) -{ - &compare_output($answer,&get_logfile(1)); +if (-f "foo") { + $test_passed = 0; } -if (-f "foo") -{ - $test_passed = 0; +if (!$vos) { + &compare_output($answer,&get_logfile(1)); } 1; diff --git a/tests/scripts/features/include b/tests/scripts/features/include index 60f4482..5f20ad8 100644 --- a/tests/scripts/features/include +++ b/tests/scripts/features/include @@ -2,7 +2,8 @@ $description = "Test various forms of the GNU make `include' command."; -$details = "Test include, -include, sinclude and various regressions involving them. +$details = "\ +Test include, -include, sinclude and various regressions involving them. Test extra whitespace at the end of the include, multiple -includes and sincludes (should not give an error) and make sure that errors are reported for targets that were also -included."; @@ -46,16 +47,36 @@ $answer = "There should be no errors for this makefile.\n"; $answer = "This is another included makefile\n"; &compare_output($answer, &get_logfile(1)); +$makefile = undef; + # Try to build the "error" target; this will fail since we don't know # how to create makeit.mk, but we should also get a message (even though # the -include suppressed it during the makefile read phase, we should # see one during the makefile run phase). -# The fix to this caused more problems than the error, so I removed it. -# pds -- 22 Jan 2000 +run_make_test + (' +-include foo.mk +error: foo.mk ; @echo $@ +', + '', + "#MAKE#: *** No rule to make target `foo.mk', needed by `error'. Stop.\n", + 512 + ); + +# Make sure that target-specific variables don't impact things. This could +# happen because a file record is created when a target-specific variable is +# set. + +run_make_test + (' +bar.mk: foo := baz +-include bar.mk +hello: ; @echo hello +', + '', + "hello\n" + ); -#&run_make_with_options($makefile, "error", &get_logfile, 512); -#$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n"; -#&compare_output($answer, &get_logfile(1)); 1; diff --git a/tests/scripts/features/order_only b/tests/scripts/features/order_only index ac0d538..82a7253 100644 --- a/tests/scripts/features/order_only +++ b/tests/scripts/features/order_only @@ -144,4 +144,15 @@ $answer = "touch baz\n"; unlink(qw(foo.w foo.x baz)); +# TEST #9 -- make sure that $< is set correctly in the face of order-only +# prerequisites in pattern rules. + +run_make_test(' +%r: | baz ; @echo $< $^ $| +bar: foo +foo:;@: +baz:;@: +', '', "foo foo baz\n"); + + 1; |