summaryrefslogtreecommitdiff
path: root/tests/scripts/misc/general4
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts/misc/general4')
-rw-r--r--tests/scripts/misc/general425
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/scripts/misc/general4 b/tests/scripts/misc/general4
index 63320e2..0b5c94a 100644
--- a/tests/scripts/misc/general4
+++ b/tests/scripts/misc/general4
@@ -5,8 +5,7 @@ This tests random features of make's algorithms, often somewhat obscure,
which have either broken at some point in the past or seem likely to
break.";
-open(MAKEFILE,"> $makefile");
-print MAKEFILE <<'EOF';
+run_make_test('
# Make sure that subdirectories built as prerequisites are actually handled
# properly.
@@ -16,13 +15,8 @@ dir/subdir: ; @echo mkdir -p dir/subdir
dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b
-dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@
-EOF
-close(MAKEFILE);
-
-&run_make_with_options($makefile,"",&get_logfile);
-$answer = "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n";
-&compare_output($answer,&get_logfile(1));
+dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@',
+ '', "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n");
# Test implicit rules
@@ -47,4 +41,17 @@ fox: baz
'done bar');
unlink('bar');
+
+# Test implicit rules with '$' in the name (see se_implicit)
+
+run_make_test(q!
+%.foo : baz$$bar ; @echo 'done $<'
+%.foo : bar$$baz ; @echo 'done $<'
+test.foo:
+fox: baz
+.DEFAULT baz$$bar bar$$baz: ; @echo '$@'
+!,
+ '',
+ 'done bar');
+
1;