summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2004-09-21 20:23:12 +0000
committerBoris Kolpackov <boris@kolpackov.net>2004-09-21 20:23:12 +0000
commit73e7767ffc14fad98dd2e78791a1237bcb3d6fe3 (patch)
tree4772e03f4350bbebfde62605316e340153d4813a /tests
parent6e51d9c90a92933e6cf84ae494076b6b1cd17c3b (diff)
downloadgunmake-73e7767ffc14fad98dd2e78791a1237bcb3d6fe3.tar.gz
Fixed bug in implicit rule prerequisite evaluation code. Added test.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog8
-rwxr-xr-xtests/run_make_tests.pl2
-rw-r--r--tests/scripts/features/implicit_prereq_eval64
3 files changed, 73 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index ba6b59e..0a7ed0c 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,11 @@
+2004-09-21 Boris Kolpackov <boris@kolpackov.net>
+
+ * run_make_tests.pl: Change `#!/usr/local/bin/perl' to be
+ `#!/usr/bin/env perl'.
+
+ * scripts/features/implicit_prereq_eval: Test implicit rule
+ prerequisite evaluation code.
+
2004-09-21 Paul D. Smith <psmith@gnu.org>
* run_make_tests.pl (run_make_test): Enhance to allow the make
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 5d49014..a4c4330 100755
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+#!/usr/bin/env perl
# -*-perl-*-
# Test driver for the Make test suite
diff --git a/tests/scripts/features/implicit_prereq_eval b/tests/scripts/features/implicit_prereq_eval
new file mode 100644
index 0000000..f549a79
--- /dev/null
+++ b/tests/scripts/features/implicit_prereq_eval
@@ -0,0 +1,64 @@
+$description = "Test implicit rule prerequisite evaluation code.";
+
+$details = "The makefile created by this test has a set of implicit rule
+ pairs with the first rule usually not applying because its prerequisites
+ cannot be made and the second rule which should succeed.";
+
+open(MAKEFILE,"> $makefile");
+
+# The contents of the Makefile ...
+
+print MAKEFILE <<EOF;
+
+.PHONY: all
+
+all: case.1 case.2 case.3
+
+a: void
+
+# 1 - existing file
+#
+%.1: void
+ \@false
+
+%.1: $makefile
+ \@true
+
+
+# 2 - phony
+#
+%.2: void
+ \@false
+
+%.2: 2.phony
+ \@true
+
+.PHONY: 2.phony
+
+
+# 3 - implicit-phony
+#
+%.3: void
+ \@false
+
+%.3: 3.implicit-phony
+ \@true
+
+3.implicit-phony:
+
+EOF
+
+close(MAKEFILE);
+
+&run_make_with_options($makefile,
+ "",
+ &get_logfile,
+ 0);
+
+
+# This makefile doesn't produce anything except exit code.
+#
+&compare_output("",&get_logfile(1));
+
+# This tells the test driver that the perl test script executed properly.
+1;