summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-09-17 21:52:45 +0000
committerPaul Smith <psmith@gnu.org>2002-09-17 21:52:45 +0000
commitdac7b49de4b935db71d7b4257c6354f16fe41cfa (patch)
treef82cb34b108309d38903bd4d1695942e0b79e951 /tests
parentd7ebcadadbfc100af64cc4c18580a6373bd52738 (diff)
downloadgunmake-dac7b49de4b935db71d7b4257c6354f16fe41cfa.tar.gz
Fix bug #940 (from the Savannah bug tracker): make sure that target-
specific variables work correctly in conjunction with double-colon targets.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog6
-rw-r--r--tests/scripts/features/targetvars45
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index fd6ef2a..a2edc50 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2002-09-17 Paul D. Smith <psmith@gnu.org>
+
+ * scripts/features/targetvars: Tests for Bug #940: test
+ target-specific and pattern-specific variables in conjunction with
+ double-colon targets.
+
2002-09-10 Paul D. Smith <psmith@gnu.org>
* test_driver.pl (compare_output): Match the new format for time
diff --git a/tests/scripts/features/targetvars b/tests/scripts/features/targetvars
index a70d3ab..06328c2 100644
--- a/tests/scripts/features/targetvars
+++ b/tests/scripts/features/targetvars
@@ -194,5 +194,50 @@ close(MAKEFILE);
$answer = "bar snafu bar\n";
&compare_output($answer, &get_logfile(1));
+# Test #13
+# Test double-colon rules with target-specific variable values
+
+$makefile6 = &get_tmpfile;
+
+open(MAKEFILE, "> $makefile6");
+print MAKEFILE <<'EOF';
+W = bad
+X = bad
+foo: W = ok
+foo:: ; @echo $(W) $(X) $(Y) $(Z)
+foo:: ; @echo $(W) $(X) $(Y) $(Z)
+foo: X = ok
+
+Y = foo
+bar: foo
+bar: Y = bar
+
+Z = nopat
+ifdef PATTERN
+ fo% : Z = pat
+endif
+
+EOF
+close(MAKEFILE);
+
+&run_make_with_options("$makefile6", "foo", &get_logfile);
+$answer = "ok ok foo nopat\nok ok foo nopat\n";
+&compare_output($answer, &get_logfile(1));
+
+# Test #14
+# Test double-colon rules with target-specific variable values and
+# inheritance
+
+&run_make_with_options("$makefile6", "bar", &get_logfile);
+$answer = "ok ok bar nopat\nok ok bar nopat\n";
+&compare_output($answer, &get_logfile(1));
+
+# Test #15
+# Test double-colon rules with pattern-specific variable values
+
+&run_make_with_options("$makefile6", "foo PATTERN=yes", &get_logfile);
+$answer = "ok ok foo pat\nok ok foo pat\n";
+&compare_output($answer, &get_logfile(1));
+
1;