summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/features/order_only35
2 files changed, 40 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 0f6da1b..76e725d 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-07 Paul D. Smith <psmith@gnu.org>
+
+ * scripts/features/order_only: Test order-only prerequisites in
+ pattern rules (patch #2349).
+
2003-11-02 Paul D. Smith <psmith@gnu.org>
* scripts/functions/if: Test if on conditionals with trailing
diff --git a/tests/scripts/features/order_only b/tests/scripts/features/order_only
index e324d68..ac0d538 100644
--- a/tests/scripts/features/order_only
+++ b/tests/scripts/features/order_only
@@ -109,4 +109,39 @@ $answer = "touch baz\n";
unlink(qw(foo baz));
+# Test order-only in pattern rules
+
+$makefile4 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile4");
+
+print MAKEFILE <<'EOF';
+%.w : %.x | baz
+ @echo '$$^ = $^'
+ @echo '$$| = $|'
+ touch $@
+
+all: foo.w
+
+.PHONY: baz
+foo.x baz:
+ touch $@
+EOF
+
+close(MAKEFILE);
+
+# TEST #7 -- make sure the parser was correct.
+
+&run_make_with_options($makefile4, "", &get_logfile);
+$answer = "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n";
+&compare_output($answer,&get_logfile(1));
+
+# TEST #8 -- now we do it again: this time foo.w won't be built
+
+&run_make_with_options($makefile4, "", &get_logfile);
+$answer = "touch baz\n";
+&compare_output($answer,&get_logfile(1));
+
+unlink(qw(foo.w foo.x baz));
+
1;