summaryrefslogtreecommitdiff
path: root/tests/scripts/features/se_statpat
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2005-02-27 21:40:23 +0000
committerBoris Kolpackov <boris@kolpackov.net>2005-02-27 21:40:23 +0000
commit659fc6b55e28740c74d66dbe3bda765d1004a12e (patch)
treea3b99015012abca13c0f7729274dff1bba322f1f /tests/scripts/features/se_statpat
parent9d153cc1b1e467cd6245755c32f78efbd62142c2 (diff)
downloadgunmake-659fc6b55e28740c74d66dbe3bda765d1004a12e.tar.gz
Implementation of the second expansion in explicit
rules, static pattern rules and implicit rules.
Diffstat (limited to 'tests/scripts/features/se_statpat')
-rw-r--r--tests/scripts/features/se_statpat106
1 files changed, 106 insertions, 0 deletions
diff --git a/tests/scripts/features/se_statpat b/tests/scripts/features/se_statpat
new file mode 100644
index 0000000..9f1b4a3
--- /dev/null
+++ b/tests/scripts/features/se_statpat
@@ -0,0 +1,106 @@
+# -*-perl-*-
+$description = "Test second expansion in static pattern rules.";
+
+$details = "";
+
+# Test #1: automatic variables.
+#
+run_make_test('
+.DEFAULT: ; @echo $@
+
+foo.a foo.b: foo.%: bar.% baz.%
+
+foo.a foo.b: foo.%: biz.% | buz.%
+
+foo.a foo.b: foo.%: $$@.1 \
+ $$<.2 \
+ $$(addsuffix .3,$$^) \
+ $$(addsuffix .4,$$+) \
+ $$|.5 \
+ $$*.6
+
+',
+'',
+'bar.a
+baz.a
+biz.a
+buz.a
+foo.a.1
+bar.a.2
+bar.a.3
+baz.a.3
+biz.a.3
+bar.a.4
+baz.a.4
+biz.a.4
+buz.a.5
+a.6
+');
+
+
+# Test #2: target/pattern -specific variables.
+#
+run_make_test('
+.DEFAULT: ; @echo $@
+
+foo.x foo.y: foo.%: $$(%_a) $$($$*_b)
+
+foo.x: x_a := bar
+
+%.x: x_b := baz
+
+
+',
+'',
+'bar
+baz
+');
+
+
+# Test #3: order of prerequisites.
+#
+run_make_test('
+.DEFAULT: ; @echo $@
+
+all: foo.a bar.a baz.a
+
+# Subtest #1
+#
+foo.a foo.b: foo.%: foo.%.1; @:
+
+foo.a foo.b: foo.%: foo.%.2
+
+foo.a foo.b: foo.%: foo.%.3
+
+
+# Subtest #2
+#
+bar.a bar.b: bar.%: bar.%.2
+
+bar.a bar.b: bar.%: bar.%.1; @:
+
+bar.a bar.b: bar.%: bar.%.3
+
+
+# Subtest #3
+#
+baz.a baz.b: baz.%: baz.%.1
+
+baz.a baz.b: baz.%: baz.%.2
+
+baz.a baz.b: ; @:
+
+',
+'',
+'foo.a.1
+foo.a.2
+foo.a.3
+bar.a.1
+bar.a.2
+bar.a.3
+baz.a.1
+baz.a.2
+');
+
+# This tells the test driver that the perl test script executed properly.
+1;