Regression test portability to Solaris.
authorPaul Smith <psmith@gnu.org>
Sun, 22 Sep 2013 15:28:46 +0000 (11:28 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 22 Sep 2013 21:10:34 +0000 (17:10 -0400)
tests/ChangeLog
tests/run_make_tests.pl
tests/scripts/features/archives
tests/scripts/features/escape
tests/scripts/features/jobserver
tests/scripts/features/output-sync
tests/scripts/features/parallelism

index d149abe32147ab3bea9e9cd616fd128941d10369..ad746d2a330d9972e6d622ebef128ec0de1b0b7a 100644 (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
index d8a093bc51bb462adc2d9b24fcf4a1c56ce617f1..54c2892238aba572622a4b64b2d7bbd63e936f48 100644 (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}
index 15f433b1eee175ba2ee457d3e874a8588db5e60f..a7ec881b4b70a779c9f0154ea1384ead3219eea3 100644 (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));
 
index 8c2b8ceab4d24440d6e8c0edef620d5c0440cad1..bf069df2250db3fb4d73b0c30381aa48bc222633 100644 (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;
index 6a9565e755baf3ff7419e133cfee779876f6e2fa..f2c67870234e8f60817f2869418c8a1019ab4a3e 100644 (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;
index e2e88a7be6e3db5072bdbd53d6133581177e7428..75d7e81defa2b80f7e1ef18e49667104ac0f6413 100644 (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);
 
index 1f56748436faefb14d6a5449a6ebf1811f2c0656..c702c2687bb0ee77fb140cb923699865a225f0f1 100644 (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));