summaryrefslogtreecommitdiff
path: root/tests/scripts/variables
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2009-06-07 17:40:06 +0000
committerPaul Smith <psmith@gnu.org>2009-06-07 17:40:06 +0000
commit0b30c8d9cef18f55e2425e32ffc1552af650a1be (patch)
tree40d5d983e80d10d04bee39765bf904c7b83d0f53 /tests/scripts/variables
parent668af4698040c6524f93165300e0f9a84312ea66 (diff)
downloadgunmake-0b30c8d9cef18f55e2425e32ffc1552af650a1be.tar.gz
- Add a new test suite for LIBPATTERNS
- Fix Savannah bug #21198 - Fix Savannah bug #21823 - Fix Savannah bug #22010
Diffstat (limited to 'tests/scripts/variables')
-rw-r--r--tests/scripts/variables/LIBPATTERNS38
-rw-r--r--tests/scripts/variables/automatic12
2 files changed, 50 insertions, 0 deletions
diff --git a/tests/scripts/variables/LIBPATTERNS b/tests/scripts/variables/LIBPATTERNS
new file mode 100644
index 0000000..826f2fa
--- /dev/null
+++ b/tests/scripts/variables/LIBPATTERNS
@@ -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;
diff --git a/tests/scripts/variables/automatic b/tests/scripts/variables/automatic
index c0fdff8..33c482d 100644
--- a/tests/scripts/variables/automatic
+++ b/tests/scripts/variables/automatic
@@ -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;