summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2009-09-28 12:31:55 +0000
committerBoris Kolpackov <boris@kolpackov.net>2009-09-28 12:31:55 +0000
commitf5891a26d8d3ed87b059856650b2bdb0c7ea355e (patch)
tree507533e9a2622b0b39cf5d0141b71ce1c6c864c4 /tests
parentf9c15cac3504546cb5ebf74241fc13ba2700691a (diff)
downloadgunmake-f5891a26d8d3ed87b059856650b2bdb0c7ea355e.tar.gz
Implement the shortest stem first search order for pattern-specific variables and pattern rules.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog8
-rw-r--r--tests/scripts/features/patspecific_vars14
-rw-r--r--tests/scripts/features/patternrules12
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c56e09a..7110e4a 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-28 Boris Kolpackov <boris@codesynthesis.com>
+
+ * scripts/features/patspecific_vars: Add a test for the shortest
+ stem first order.
+
+ * scripts/features/patternrules: Add a test for the shortest stem
+ first order.
+
2009-09-24 Paul Smith <psmith@gnu.org>
* scripts/features/se_implicit: Add a test for order-only
diff --git a/tests/scripts/features/patspecific_vars b/tests/scripts/features/patspecific_vars
index 355e86d..8ca228d 100644
--- a/tests/scripts/features/patspecific_vars
+++ b/tests/scripts/features/patspecific_vars
@@ -131,4 +131,18 @@ ab: ; @echo "$(FOO)"
run_make_test(undef, 'FOO=C', "C f1\n");
+# TEST #9: Test shortest stem selection in pattern-specific variables.
+
+run_make_test('
+%-mt.x: x := two
+%.x: x := one
+
+all: foo.x foo-mt.x
+
+foo.x: ;@echo $x
+foo-mt.x: ;@echo $x
+',
+'',
+"one\ntwo");
+
1;
diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules
index dcaf0dd..eebe7c0 100644
--- a/tests/scripts/features/patternrules
+++ b/tests/scripts/features/patternrules
@@ -207,6 +207,18 @@ CWEAVE := :
unlink(@f);
+# TEST #9: Test shortest stem selection in pattern rules.
+
+run_make_test('
+%.x: ;@echo one
+%-mt.x: ;@echo two
+
+all: foo.x foo-mt.x
+',
+'',
+"one\ntwo");
+
+1;
# This tells the test driver that the perl test script executed properly.
1;