+2011-07-27 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: fix spurious failures with Solaris /bin/sh
+ * tests/tap-more.test: Use `echo > file', not `: > file', to
+ create empty files in the "for" loops; this is required since,
+ as documented in the autoconf manual, Solaris 10 /bin/sh
+ "optimizes" away the `:' command after the first iteration,
+ even if it is redirected.
+ * tests/test-driver-custom-multitest-recheck2.test: Likewise.
+ * tests/tap-numeric-description.test: Partial rewrite to avoid
+ using positional parameters from the 10th onward, which are
+ unportable to Solaris /bin/sh (using `${10}' causes the shell
+ to die with "bad substitution").
+
2011-07-31 Stefano Lattarini <stefano.lattarini@gmail.com>
simple tests: support developer-defined fd redirections
ls -l # For debugging.
# Success.
+
$run_make check >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=6 pass=4 fail=0 xpass=0 xfail=1 skip=1 error=0
test `$FGREP -c '3.test' stdout` -eq 2
# Failure.
- : > not-skip
- : > bail-out
+
+ # Use `echo' here, since Solaris 10 /bin/sh would try to optimize
+ # a `:' away after the first iteration, even if it is redirected.
+ echo dummy > not-skip
+ echo dummy > bail-out
$run_make check >stdout && { cat stdout; Exit 1; }
cat stdout
count_test_results total=7 pass=4 fail=1 xpass=0 xfail=1 skip=0 error=1
TESTS = all.test
END
-# Some random numbers to be used as test names.
-# These are selected so that $n != n for every n >= 1.
-set 5 7 45 11 7 3 6 9 1000 1
-# $1 $2 $3 $4 $5 $6 $7 $8 $9 $10
+# Some random numbers to be used as test names. The definitions below are
+# selected so that $x<n> != <n> for every n >= 1. We can't use positional
+# parameters for this unfortunately, since Solaris 10 /bin/sh doesn't allow
+# the dereferencing of parameters from ${10} onwards.
+x1=5 x2=7 x3=45 x4=11 x5=7 x6=3 x7=6 x8=9 x9=1000 x10=1
cat > all.test <<END
1..10
-ok 1 ${1}
-ok - ${2}
-not ok 3 ${3}
-not ok - ${4}
-ok 5 ${5} # SKIP
-ok - ${6} # SKIP
-not ok 7 ${7} # TODO
-not ok - ${8} # TODO
-ok 9 ${9} # TODO
-ok - ${10} # TODO
+ok 1 ${x1}
+ok - ${x2}
+not ok 3 ${x3}
+not ok - ${x4}
+ok 5 ${x5} # SKIP
+ok - ${x6} # SKIP
+not ok 7 ${x7} # TODO
+not ok - ${x8} # TODO
+ok 9 ${x9} # TODO
+ok - ${x10} # TODO
END
cat > exp <<END
-PASS: all.test 1 ${1}
-PASS: all.test 2 - ${2}
-FAIL: all.test 3 ${3}
-FAIL: all.test 4 - ${4}
-SKIP: all.test 5 ${5} # SKIP
-SKIP: all.test 6 - ${6} # SKIP
-XFAIL: all.test 7 ${7} # TODO
-XFAIL: all.test 8 - ${8} # TODO
-XPASS: all.test 9 ${9} # TODO
-XPASS: all.test 10 - ${10} # TODO
+PASS: all.test 1 ${x1}
+PASS: all.test 2 - ${x2}
+FAIL: all.test 3 ${x3}
+FAIL: all.test 4 - ${x4}
+SKIP: all.test 5 ${x5} # SKIP
+SKIP: all.test 6 - ${x6} # SKIP
+XFAIL: all.test 7 ${x7} # TODO
+XFAIL: all.test 8 - ${x8} # TODO
+XPASS: all.test 9 ${x9} # TODO
+XPASS: all.test 10 - ${x10} # TODO
END
$ACLOCAL
: No need to re-run a.test anymore, but c.test should be rerun,
: as it contained an XPASS. And this time, make it fail with
: an hard error.
- : > c.err
+ # Use `echo' here, since Solaris 10 /bin/sh would try to optimize
+ # a `:' away after the first iteration, even if it is redirected.
+ echo dummy > c.err
env TEST_LOGS='a.log c.log' $MAKE -e recheck >stdout \
&& { cat stdout; Exit 1; }
cat stdout
: c.test contained and hard error the last time, so it should be re-run.
: This time, make it pass
- : > c.ok
+ # Use `echo', not `:'; see comments above for why.
+ echo dummy > c.ok
env TESTS='c.test a.test' $MAKE -e recheck >stdout \
|| { cat stdout; Exit 1; }
cat stdout