summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/options/dash-W28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/scripts/options/dash-W b/tests/scripts/options/dash-W
index baa04a5..50745f7 100644
--- a/tests/scripts/options/dash-W
+++ b/tests/scripts/options/dash-W
@@ -57,4 +57,32 @@ run_make_test(undef, '-W bar.x', "restarts=\ntouch foo.x\nrestarts=1\ntouch baz.
rmfiles('foo.x', 'bar.x');
+# Test -W on vpath-found files: it should take effect.
+# Savannah bug # 15341
+
+mkdir('x-dir');
+utouch(-20, 'x-dir/x');
+touch('y');
+
+run_make_test('
+y: x ; @echo cp $< $@
+',
+ '-W x-dir/x VPATH=x-dir',
+ 'cp x-dir/x y');
+
+# Make sure ./ stripping doesn't interfere with the match.
+
+run_make_test('
+y: x ; @echo cp $< $@
+',
+ '-W ./x-dir/x VPATH=x-dir',
+ 'cp x-dir/x y');
+
+run_make_test(undef,
+ '-W x-dir/x VPATH=./x-dir',
+ 'cp ./x-dir/x y');
+
+unlink(qw(y x-dir/x));
+rmdir('x-dir');
+
1;