Regression test portability to Solaris.

This commit is contained in:
Paul Smith 2013-09-22 11:28:46 -04:00
parent 1a991ada47
commit 65931ce7a9
7 changed files with 59 additions and 14 deletions

View file

@ -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

View file

@ -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}

View file

@ -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));

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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));