In the shell test framework, an error is either flagged by setting
the shell variable fail=1, or by invoking the fail_ function with an
error diagnostic.
* tests/init.sh (returns_): Change example code in the comment to
use '|| fail=1' properly.
+2024-08-05 Bernhard Voelker <mail@bernhard-voelker.de>
+
+ test-framework-sh: Improve returns_ example.
+ In the shell test framework, an error is either flagged by setting
+ the shell variable fail=1, or by invoking the fail_ function with an
+ error diagnostic.
+ * tests/init.sh (returns_): Change example code in the comment to
+ use '|| fail=1' properly.
+
2024-07-29 Bruno Haible <bruno@clisp.org>
vaszprintf-posix tests: Fix a gcc warning.
# I.e., just doing `command ... &&fail=1` will not catch
# a segfault in command for example. With this helper you
# instead check an explicit exit code like
-# returns_ 1 command ... || fail
+# returns_ 1 command ... || fail=1
returns_ () {
# Disable tracing so it doesn't interfere with stderr of the wrapped command
{ local is_tracing=`{ :; } 2>&1`; } 2>/dev/null