summaryrefslogtreecommitdiff
path: root/tests/scripts/features
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2004-09-22 04:36:17 +0000
committerPaul Smith <psmith@gnu.org>2004-09-22 04:36:17 +0000
commit29d78ddb2842d75956fb9b2f50fa7032f6a28416 (patch)
tree18e57d8b1de21618a9f7071fa9f24879a2fc1e97 /tests/scripts/features
parent73e7767ffc14fad98dd2e78791a1237bcb3d6fe3 (diff)
downloadgunmake-29d78ddb2842d75956fb9b2f50fa7032f6a28416.tar.gz
Update the test template. A few fixes in run_make_test().
Rename implicit_prereq_eval to patternrules, to be the start of a suite of tests of pattern rules.
Diffstat (limited to 'tests/scripts/features')
-rw-r--r--tests/scripts/features/implicit_prereq_eval64
-rw-r--r--tests/scripts/features/patternrules40
2 files changed, 40 insertions, 64 deletions
diff --git a/tests/scripts/features/implicit_prereq_eval b/tests/scripts/features/implicit_prereq_eval
deleted file mode 100644
index f549a79..0000000
--- a/tests/scripts/features/implicit_prereq_eval
+++ /dev/null
@@ -1,64 +0,0 @@
-$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;
diff --git a/tests/scripts/features/patternrules b/tests/scripts/features/patternrules
new file mode 100644
index 0000000..926695a
--- /dev/null
+++ b/tests/scripts/features/patternrules
@@ -0,0 +1,40 @@
+# -*-perl-*-
+
+$description = "Test pattern rules.";
+
+$details = "";
+
+# Make sure that multiple patterns where the same target can be built are
+# searched even if the first one fails to match properly.
+
+run_make_test('
+.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:
+', '', '');
+
+
+# This tells the test driver that the perl test script executed properly.
+1;