]> git.draconx.ca Git - dxcommon.git/commitdiff
test-tap: Fix Solaris /bin/sh "prove: not found" on stderr.
authorNick Bowler <nbowler@draconx.ca>
Sat, 1 Jul 2023 21:32:57 +0000 (17:32 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sat, 1 Jul 2023 21:36:22 +0000 (17:36 -0400)
The prove command is intended to be optional, just to display a summary
of the test result if it is available.  However, on old Solaris /bin/sh,
our command

  prove ... 2>&1

doesn't redirect the error message from the shell when prove is not
found.  We can use a command like like

  { prove ...; } 2>&1

instead, which does redirect the error.

snippet/test-tap.at

index cccea491342efd67d4649901aaa545d5ea14ecc4..2873cf463b41754320fe72365698afbc35f2fb83 100644 (file)
@@ -25,7 +25,7 @@ test_run_tap () {
   # Older versions of prove do not support the -e option so the
   # "test" must be a perl script.
   :; { echo 'print <<EOF'; cat "$program.tap"; echo 'EOF'; } >"$program.pl"
-  prove "$program.pl" 2>&1
+  { prove "$program.pl"; } 2>&1
   return $status
 }
 m4_divert_pop([PREPARE_TESTS])])