diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 11 | ||||
-rwxr-xr-x | tests/run_make_tests.pl | 6 | ||||
-rw-r--r-- | tests/scripts/features/patspecific_vars | 35 |
3 files changed, 41 insertions, 11 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index b4ba23e..3880e8a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,14 @@ +2003-04-19 Paul D. Smith <psmith@gnu.org> + + * scripts/features/patspecific_vars: Test multiple patterns + matching the same target--Bug #1405. + +2003-04-09 Paul D. Smith <psmith@gnu.org> + + * run_make_tests.pl (set_more_defaults): A new $port_type of + 'OS/2' for (surprise!) OS/2. Also choose a wait time of 2 seconds + for OS/2. + 2003-03-28 Paul D. Smith <psmith@gnu.org> * scripts/targets/SECONDARY: Test the "global" .SECONDARY (with diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl index 0ada574..4389d43 100755 --- a/tests/run_make_tests.pl +++ b/tests/run_make_tests.pl @@ -169,6 +169,10 @@ sub set_more_defaults elsif ($osname =~ /^([^ ]*|[^ ]* [^ ]*)D(OS|os|ev) /) { $port_type = 'DOS'; } + # Check for OS/2 + elsif ($osname =~ m%OS/2%) { + $port_type = 'OS/2'; + } # Everything else, right now, is UNIX. Note that we should integrate # the VOS support into this as well and get rid of $vos; we'll do # that next time. @@ -180,7 +184,7 @@ sub set_more_defaults # timestamps with second granularity (!!). Change the sleep time # needed to force a file to be considered "old". # - $wtime = $port_type eq 'UNIX' ? 1 : 4; + $wtime = $port_type eq 'UNIX' ? 1 : $port_type eq 'OS/2' ? 2 : 4; # Find the full pathname of Make. For DOS systems this is more # complicated, so we ask make itself. diff --git a/tests/scripts/features/patspecific_vars b/tests/scripts/features/patspecific_vars index 7feb687..9ace5c4 100644 --- a/tests/scripts/features/patspecific_vars +++ b/tests/scripts/features/patspecific_vars @@ -13,14 +13,22 @@ all: one.x two.x three.x FOO = foo BAR = bar BAZ = baz -thr% : override BAZ = three -t%.x: BAR = four -%.x: BAR = two -%.x: override BAZ = three one.x: override FOO = one -one.x two.x three.x: ; @echo $(FOO) $(BAR) $(BAZ) -four.x: baz ; @echo $(FOO) $(BAR) $(BAZ) -baz: ; @echo $(FOO) $(BAR) $(BAZ) +%.x: BAR = two +t%.x: BAR = four +thr% : override BAZ = three +one.x two.x three.x: ; @echo $@: $(FOO) $(BAR) $(BAZ) +four.x: baz ; @echo $@: $(FOO) $(BAR) $(BAZ) +baz: ; @echo $@: $(FOO) $(BAR) $(BAZ) + +# test matching multiple patterns +a%: AAA = aaa +%b: BBB = ccc +a%: BBB += ddd +%b: AAA ?= xxx +%b: AAA += bbb +.PHONY: ab +ab: ; @echo $(AAA); echo $(BBB) EOF close(MAKEFILE); @@ -29,21 +37,28 @@ close(MAKEFILE); # TEST #1 -- basics &run_make_with_options($makefile, "", &get_logfile); -$answer = "one two three\nfoo four baz\nfoo bar three\n"; +$answer = "one.x: one two baz\ntwo.x: foo four baz\nthree.x: foo four three\n"; &compare_output($answer,&get_logfile(1)); # TEST #2 -- try the override feature &run_make_with_options($makefile, "BAZ=five", &get_logfile); -$answer = "one two three\nfoo four five\nfoo bar three\n"; +$answer = "one.x: one two five\ntwo.x: foo four five\nthree.x: foo four three\n"; &compare_output($answer,&get_logfile(1)); # TEST #3 -- make sure patterns are inherited properly &run_make_with_options($makefile, "four.x", &get_logfile); -$answer = "foo two three\nfoo two three\n"; +$answer = "baz: foo two baz\nfour.x: foo two baz\n"; +&compare_output($answer,&get_logfile(1)); + + +# TEST #4 -- test multiple patterns matching the same target + +&run_make_with_options($makefile, "ab", &get_logfile); +$answer = "aaa bbb\nccc ddd\n"; &compare_output($answer,&get_logfile(1)); 1; |