summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog8
-rw-r--r--tests/scripts/targets/POSIX27
-rw-r--r--tests/scripts/variables/SHELL22
-rw-r--r--tests/test_driver.pl2
4 files changed, 37 insertions, 22 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 66682ac..d036568 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,11 @@
+2010-07-28 Paul Smith <psmith@gnu.org>
+
+ * scripts/targets/POSIX: Compatibility issues with Solaris (and
+ Tru64?); "false" returns different exit codes, and set -x shows
+ output with extra whitespace. Run the commands by hand first to
+ find out what the real shell would do, then compare what make does.
+ * scripts/variables/SHELL: Ditto.
+
2010-07-12 Paul Smith <psmith@gnu.org>
* test_driver.pl: Add a new $perl_name containing the path to Perl.
diff --git a/tests/scripts/targets/POSIX b/tests/scripts/targets/POSIX
index 1b57448..9c30e18 100644
--- a/tests/scripts/targets/POSIX
+++ b/tests/scripts/targets/POSIX
@@ -6,23 +6,28 @@ $details = "";
# Ensure turning on .POSIX enables the -e flag for the shell
-# We can't just use "false" because on different systems it provides a
-# different exit code.
-
-run_make_test(q!
+# We can't assume the exit value of "false" because on different systems it's
+# different.
+
+my $script = 'false; true';
+my $flags = '-ec';
+my $out = `/bin/sh $flags '$script' 2>&1`;
+my $err = $? >> 8;
+run_make_test(qq!
.POSIX:
-all: ; @r() { return 1; }; r; true
+all: ; \@$script
!,
- '', "#MAKE#: *** [all] Error 1\n", 512);
+ '', "#MAKE#: *** [all] Error $err\n", 512);
# User settings must override .POSIX
-
-run_make_test(q!
-.SHELLFLAGS = -xc
+$flags = '-xc';
+$out = `/bin/sh $flags '$script' 2>&1`;
+run_make_test(qq!
+.SHELLFLAGS = $flags
.POSIX:
-all: ; @r() { return 1; }; r; true
+all: ; \@$script
!,
- '', "+ r\n+ return 1\n+ true\n");
+ '', $out);
# This tells the test driver that the perl test script executed properly.
1;
diff --git a/tests/scripts/variables/SHELL b/tests/scripts/variables/SHELL
index 0028d9f..7b7e7fe 100644
--- a/tests/scripts/variables/SHELL
+++ b/tests/scripts/variables/SHELL
@@ -58,27 +58,29 @@ one two:;@echo "$@: $(SHELL) $$SHELL"
# Test .SHELLFLAGS
-# We can't assume the value here: on Solaris for example, every line printed
+# We don't know the output here: on Solaris for example, every line printed
# by the shell in -x mode has a trailing space (!!)
-my $script = 'true';
-my $out = `/bin/sh -xc '$script' 2>&1`;
+my $script = 'true; true';
+my $flags = '-xc';
+my $out = `/bin/sh $flags '$script' 2>&1`;
run_make_test(qq!
-.SHELLFLAGS = -xc
+.SHELLFLAGS = $flags
all: ; \@$script
!,
'', $out);
# We can't just use "false" because on different systems it provides a
-# different exit code.
-
-my $script = 'r() { return 1; }; true; r; true';
-my $out = `/bin/sh -xec '$script' 2>&1`;
+# different exit code--once again Solaris: false exits with 255 not 1
+$script = 'true; false; true';
+$flags = '-xec';
+$out = `/bin/sh $flags '$script' 2>&1`;
+my $err = $? >> 8;
run_make_test(qq!
-.SHELLFLAGS = -xec
+.SHELLFLAGS = $flags
all: ; \@$script
!,
- '', "$out#MAKE#: *** [all] Error 1\n", 512);
+ '', "$out#MAKE#: *** [all] Error $err\n", 512);
1;
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index dc0c29a..06e8a6a 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -802,7 +802,7 @@ sub _run_command
eval {
local $SIG{ALRM} = sub { die "timeout\n"; };
alarm $test_timeout;
- $code = system @_;
+ $code = system(@_);
alarm 0;
};
if ($@) {