mirror of
https://github.com/mirror/make.git
synced 2026-08-10 17:14:33 +00:00
- Add a new test suite for LIBPATTERNS
- Fix Savannah bug #21198 - Fix Savannah bug #21823 - Fix Savannah bug #22010
This commit is contained in:
38
tests/scripts/variables/LIBPATTERNS
Normal file
38
tests/scripts/variables/LIBPATTERNS
Normal file
@@ -0,0 +1,38 @@
|
||||
# -*-perl-*-
|
||||
|
||||
$description = "Test .LIBPATTERNS special variable.";
|
||||
|
||||
$details = "";
|
||||
|
||||
# TEST 0: basics
|
||||
|
||||
touch('mtest_foo.a');
|
||||
|
||||
run_make_test('
|
||||
.LIBPATTERNS = mtest_%.a
|
||||
all: -lfoo ; @echo "build $@ from $<"
|
||||
',
|
||||
'', "build all from mtest_foo.a\n");
|
||||
|
||||
# TEST 1: Handle elements that are not patterns.
|
||||
|
||||
run_make_test('
|
||||
.LIBPATTERNS = mtest_foo.a mtest_%.a
|
||||
all: -lfoo ; @echo "build $@ from $<"
|
||||
',
|
||||
'', "#MAKE#: .LIBPATTERNS element `mtest_foo.a' is not a pattern
|
||||
build all from mtest_foo.a\n");
|
||||
|
||||
# TEST 2: target-specific override
|
||||
|
||||
# Uncomment this when we add support, see Savannah bug #25703
|
||||
# run_make_test('
|
||||
# .LIBPATTERNS = mbad_%.a
|
||||
# all: .LIBPATTERNS += mtest_%.a
|
||||
# all: -lfoo ; @echo "build $@ from $<"
|
||||
# ',
|
||||
# '', "build all from mtest_foo.a\n");
|
||||
|
||||
unlink('mtest_foo.a');
|
||||
|
||||
1;
|
||||
@@ -107,4 +107,16 @@ bar: ;',
|
||||
|
||||
unlink('foo');
|
||||
|
||||
# TEST #4: ensure prereq ordering is correct when the commmand target has none
|
||||
# See Savannah bug #21198
|
||||
|
||||
run_make_test('
|
||||
all : A B
|
||||
all : ; @echo $@ -- $^ -- $<
|
||||
all : C D
|
||||
all : E F
|
||||
A B C D E F G H : ; @:
|
||||
',
|
||||
'', "all -- A B C D E F -- A\n");
|
||||
|
||||
1;
|
||||
|
||||
Reference in New Issue
Block a user