summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2011-09-18 20:52:13 +0000
committerPaul Smith <psmith@gnu.org>2011-09-18 20:52:13 +0000
commit0369a938254747fa2ab9ea09fe48b9c84ae7e19e (patch)
tree7da506b5572599eff91c1cb67bc1118d3defc885 /tests/scripts
parentef2b0425e76888e862796a2f38f885a1371b0724 (diff)
downloadgunmake-0369a938254747fa2ab9ea09fe48b9c84ae7e19e.tar.gz
We compute various values for vpath lookup the first time through
and store them in static variables; however one value (std_dirs) was not being stored statically so the second time through it was not set. Fixes Savannah bug #32511
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/features/vpath365
1 files changed, 25 insertions, 40 deletions
diff --git a/tests/scripts/features/vpath3 b/tests/scripts/features/vpath3
index 978c5ee..c6ede28 100644
--- a/tests/scripts/features/vpath3
+++ b/tests/scripts/features/vpath3
@@ -1,50 +1,35 @@
-# -*-perl-*-
+# -*-perl-*-
$description = "Test the interaction of the -lfoo feature and vpath";
$details = "";
-open(MAKEFILE,"> $makefile");
-
-# The Contents of the MAKEFILE ...
-
-print MAKEFILE "vpath %.a a1\n";
-print MAKEFILE "vpath %.so b1\n";
-print MAKEFILE "vpath % a2 b2\n";
-print MAKEFILE "vpath % b3\n";
-print MAKEFILE "all: -l1 -l2 -l3; \@echo \$^\n";
-
-# END of Contents of MAKEFILE
-
-close(MAKEFILE);
-
-mkdir("a1", 0777);
-mkdir("b1", 0777);
-mkdir("a2", 0777);
-mkdir("b2", 0777);
-mkdir("b3", 0777);
-
-@files_to_touch = ("a1${pathsep}lib1.a",
- "b1${pathsep}lib1.so",
- "a2${pathsep}lib2.a",
- "b2${pathsep}lib2.so",
- "lib3.a",
- "b3${pathsep}lib3.so");
+my @dirs_to_make = qw(a1 b1 a2 b2 b3);
+for my $d (@dirs_to_make) {
+ mkdir($d, 0777);
+}
+my @files_to_touch = ("a1${pathsep}lib1.a",
+ "a1${pathsep}libc.a",
+ "b1${pathsep}lib1.so",
+ "a2${pathsep}lib2.a",
+ "b2${pathsep}lib2.so",
+ "lib3.a",
+ "b3${pathsep}lib3.so");
&touch(@files_to_touch);
-&run_make_with_options($makefile,"",&get_logfile);
-
-# Create the answer to what should be produced by this Makefile
-$answer = "a1${pathsep}lib1.a a2${pathsep}lib2.a lib3.a\n";
-
-if (&compare_output($answer,&get_logfile(1)))
-{
- unlink @files_to_touch;
- rmdir("a1");
- rmdir("b1");
- rmdir("a2");
- rmdir("b2");
- rmdir("b3");
+run_make_test('
+vpath %.h b3
+vpath %.a a1
+vpath %.so b1
+vpath % a2 b2
+vpath % b3
+all: -l1 -lc -l2 -l3; @echo $^
+',
+ '', "a1${pathsep}lib1.a a1${pathsep}libc.a a2${pathsep}lib2.a lib3.a\n");
+
+unlink(@files_to_touch);
+for my $d (@dirs_to_make) {
+ rmdir($d);
}
1;