summaryrefslogtreecommitdiff
path: root/tests/scripts/features/patspecific_vars
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-09-14 02:03:19 +0000
committerPaul Smith <psmith@gnu.org>1999-09-14 02:03:19 +0000
commit0d366b668244112846554c42045ff1d9956276ed (patch)
tree3802242fe18a5e90d889f5d1ac66fb487361888b /tests/scripts/features/patspecific_vars
parent4121dea6a59367b4431cbe7a3c43d74fec9fd832 (diff)
downloadgunmake-0d366b668244112846554c42045ff1d9956276ed.tar.gz
* Added the test suite to the main distribution.
Diffstat (limited to 'tests/scripts/features/patspecific_vars')
-rw-r--r--tests/scripts/features/patspecific_vars40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/scripts/features/patspecific_vars b/tests/scripts/features/patspecific_vars
new file mode 100644
index 0000000..0684a80
--- /dev/null
+++ b/tests/scripts/features/patspecific_vars
@@ -0,0 +1,40 @@
+# -*-perl-*-
+$description = "Test pattern-specific variable settings.";
+
+$details = "\
+Create a makefile containing various flavors of pattern-specific variable
+settings, override and non-override, and using various variable expansion
+rules, semicolon interference, etc.";
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE <<'EOF';
+all: one.x two.x three.x
+FOO = foo
+BAR = bar
+BAZ = baz
+thr% : override BAZ = three
+t%.x: BAR = four
+%.x: BAR = two
+%.x: override BAZ = three
+one.x: override FOO = one
+one.x two.x three.x: ; @echo $(FOO) $(BAR) $(BAZ)
+EOF
+
+close(MAKEFILE);
+
+
+# TEST #1 -- basics
+
+&run_make_with_options($makefile, "", &get_logfile);
+$answer = "one two three\nfoo four baz\nfoo bar three\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2 -- try the override feature
+
+&run_make_with_options($makefile, "BAZ=five", &get_logfile);
+$answer = "one two three\nfoo four five\nfoo bar three\n";
+&compare_output($answer,&get_logfile(1));
+
+1;