summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-22 11:28:46 -0400
committerPaul Smith <psmith@gnu.org>2013-09-22 17:10:34 -0400
commit65931ce7a9a84ddb9adb118b7558bfd1b8c3ee46 (patch)
tree2267155ce5a4ae0f8b2b6e6e67eb315e33e3cb97 /tests
parent1a991ada47e0c98ddcb4b2d30b1cf14e4b6a949a (diff)
downloadgunmake-65931ce7a9a84ddb9adb118b7558bfd1b8c3ee46.tar.gz
Regression test portability to Solaris.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog16
-rw-r--r--tests/run_make_tests.pl9
-rw-r--r--tests/scripts/features/archives26
-rw-r--r--tests/scripts/features/escape10
-rw-r--r--tests/scripts/features/jobserver6
-rw-r--r--tests/scripts/features/output-sync2
-rw-r--r--tests/scripts/features/parallelism4
7 files changed, 59 insertions, 14 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index d149abe..ad746d2 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,19 @@
+2013-09-22 Paul Smith <psmith@gnu.org>
+
+ * run_make_tests.pl (set_more_defaults): If we can't find
+ gnumake.h based on the make program we might be running from a
+ remote build directory. Parse the Makefile for the right path.
+
+ Fix some test issues on Solaris.
+
+ * scripts/features/archives: Determine what output ar gives when
+ adding and replacing objects and compare with that.
+ * scripts/features/escape: Solaris /bin/sh doesn't properly handle
+ backslashes inside single quotes, so don't rely on it.
+ * scripts/features/output-sync: false(1) gives different exit
+ codes on different systems; use "exit 1" instead.
+ * scripts/features/parallelism: Increase the timeout for slower systems.
+
2013-09-21 Paul Smith <psmith@gnu.org>
* scripts/features/archives: Some versions of ar (MacOSX) generate
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index d8a093b..54c2892 100644
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -369,6 +369,15 @@ sub set_more_defaults
-f "${d}gnumake.h" and $srcdir = $d;
}
+ # Not with the make program, so see if we can get it out of the makefile
+ if (! $srcdir && open(MF, "< ../Makefile")) {
+ local $/ = undef;
+ $_ = <MF>;
+ close(MF);
+ /^abs_srcdir\s*=\s*(.*?)\s*$/m;
+ -f "$1/gnumake.h" and $srcdir = $1;
+ }
+
# Get Purify log info--if any.
if (exists $ENV{PURIFYOPTIONS}
diff --git a/tests/scripts/features/archives b/tests/scripts/features/archives
index 15f433b..a7ec881 100644
--- a/tests/scripts/features/archives
+++ b/tests/scripts/features/archives
@@ -13,6 +13,15 @@ utouch(-60, qw(a1.o a2.o a3.o));
# Some versions of ar print different things on creation. Find out.
my $created = `ar rv libxx.a a1.o 2>&1`;
+
+# Some versions of ar print different things on add. Find out.
+my $add = `ar rv libxx.a a2.o 2>&1`;
+$add =~ s/a2\.o/#OBJECT#/g;
+
+# Some versions of ar print different things on replacement. Find out.
+my $repl = `ar rv libxx.a a2.o 2>&1`;
+$repl =~ s/a2\.o/#OBJECT#/g;
+
unlink('libxx.a');
# Very simple
@@ -20,12 +29,14 @@ run_make_test('all: libxx.a(a1.o)',
'', "ar rv libxx.a a1.o\n$created");
# Multiple .o's. Add a new one to the existing library
+($_ = $add) =~ s/#OBJECT#/a2.o/g;
run_make_test('all: libxx.a(a1.o a2.o)',
- '', "ar rv libxx.a a2.o\na - a2.o\n");
+ '', "ar rv libxx.a a2.o\n$_");
# Touch one of the .o's so it's rebuilt
utouch(-40, 'a1.o');
-run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
+($_ = $repl) =~ s/#OBJECT#/a1.o/g;
+run_make_test(undef, '', "ar rv libxx.a a1.o\n$_");
# Use wildcards
run_make_test('all: libxx.a(*.o)',
@@ -33,17 +44,22 @@ run_make_test('all: libxx.a(*.o)',
# Touch one of the .o's so it's rebuilt
utouch(-30, 'a1.o');
-run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
+($_ = $repl) =~ s/#OBJECT#/a1.o/g;
+run_make_test(undef, '', "ar rv libxx.a a1.o\n$_");
# Use both wildcards and simple names
utouch(-50, 'a2.o');
+($_ = $add) =~ s/#OBJECT#/a3.o/g;
+$_ .= "ar rv libxx.a a2.o\n";
+($_ .= $repl) =~ s/#OBJECT#/a2.o/g;
run_make_test('all: libxx.a(a3.o *.o)', '',
- "ar rv libxx.a a3.o\na - a3.o\nar rv libxx.a a2.o\nr - a2.o\n");
+ "ar rv libxx.a a3.o\n$_");
# Check whitespace handling
utouch(-40, 'a2.o');
+($_ = $repl) =~ s/#OBJECT#/a2.o/g;
run_make_test('all: libxx.a( a3.o *.o )', '',
- "ar rv libxx.a a2.o\nr - a2.o\n");
+ "ar rv libxx.a a2.o\n$_");
rmfiles(qw(a1.o a2.o a3.o libxx.a));
diff --git a/tests/scripts/features/escape b/tests/scripts/features/escape
index 8c2b8ce..bf069df 100644
--- a/tests/scripts/features/escape
+++ b/tests/scripts/features/escape
@@ -54,19 +54,21 @@ run_make_test(undef,
# Test escaped colons in prerequisites
# Quoting of backslashes in q!! is kind of messy.
+# Solaris sh does not properly handle backslashes even in '' so just
+# check the output make prints, not what the shell interprets.
run_make_test(q!
foo: foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar
-foo foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar: ; @echo '$@'
+foo foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar: ; : '$@'
!,
- '', "foo:bar\nfoo\\:bar\nfoo\\\\:bar\nfoo\n");
+ '', ": 'foo:bar'\n: 'foo\\:bar'\n: 'foo\\\\:bar'\n: 'foo'\n");
# Test backslash before non-special chars: should be kept as-is
run_make_test(q!
all: ..\foo
-.DEFAULT: ; @echo '$@'
+.DEFAULT: ; : '$@'
!,
- '', '..\foo');
+ '', ": '..\\foo'\n");
# This tells the test driver that the perl test script executed properly.
1;
diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver
index 6a9565e..f2c6787 100644
--- a/tests/scripts/features/jobserver
+++ b/tests/scripts/features/jobserver
@@ -19,6 +19,8 @@ if (!$parallel_jobs) {
# get one from the original invocation and none from the re-exec.
# See Savannah bug #18124
+unlink('inc.mk');
+
run_make_test(q!
-include inc.mk
recur:
@@ -34,7 +36,7 @@ inc.mk:
!,
'--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
-rmfiles('inc.mk');
+unlink('inc.mk');
# Test recursion when make doesn't think it exists.
# See Savannah bug #39934
@@ -54,6 +56,6 @@ default: ; @ #MAKEPATH# -f Makefile2
"#MAKE#[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
#MAKE#[1]: Nothing to be done for 'foo'.");
-unlink('Makefile2');
+rmfiles('Makefile2');
1;
diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
index e2e88a7..75d7e81 100644
--- a/tests/scripts/features/output-sync
+++ b/tests/scripts/features/output-sync
@@ -91,7 +91,7 @@ foo-fail:
\t\@echo foo-fail: start
\t\@$wait_bar
\t\@echo foo-fail: end
-\t\@false
+\t\@exit 1
EOF
close(MAKEFILE);
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index 1f56748..c702c26 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -41,7 +41,7 @@ all: 1 2; \@echo success
1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@
2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@",
"-j4",
- "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
+ "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7);
rmfiles(qw(1.inc 2.inc));
@@ -60,7 +60,7 @@ endif
1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@
2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@",
"-j4",
- "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
+ "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7);
rmfiles(qw(1.inc 2.inc));