On 2024-06-11, I did: > diff --git a/tests/init.sh b/tests/init.sh > index 4689b6b758..2724f5ab67 100644 > --- a/tests/init.sh > +++ b/tests/init.sh > @@ -594,6 +594,7 @@ fi > # returns_ 1 command ... || fail > returns_ () { > # Disable tracing so it doesn't interfere with stderr of the wrapped > command > + local is_tracing=`{ :; } 2>&1` > { set +x; } 2>/dev/null > > local exp_exit="$1"
This causes a test failure of the test-dfa-invalid-merge.sh test, both in the GNU grep package and in the GNU sed package. (The same test works in a gnulib testdir. I have no idea why??) The test's log contains this: ... + LC_ALL=C returns_ 0 test-dfa-match-aux x+x+x+ xx + compare /dev/null out + compare_dev_null_ /dev/null out + test 2 = 2 + test x/dev/null = x/dev/null + test -s out + emit_diff_u_header_ /dev/null out + printf %s\n diff -u /dev/null out --- /dev/null 1970-01-01 +++ out 1970-01-01 diff -u /dev/null out --- /dev/null 1970-01-01 +++ out 1970-01-01 + sed s/^/+/ out ++ local is_tracing=+ : + return 1 + return 1 + fail=1 ... So, apparently, the tracing output of the 'local is_tracing=...' line is causing the trouble. This patch fixes it. 2024-06-20 Bruno Haible <br...@clisp.org> test-framework-sh: Fix side effect on dfa tests (regression 2024-06-11). * tests/init.sh (returns_): Silence the 'local is_tracing' assignment. diff --git a/tests/init.sh b/tests/init.sh index 237db02fb0..87e6557649 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -598,7 +598,7 @@ fi # returns_ 1 command ... || fail returns_ () { # Disable tracing so it doesn't interfere with stderr of the wrapped command - local is_tracing=`{ :; } 2>&1` + local is_tracing=`{ :; } 2>&1` 2>/dev/null { set +x; } 2>/dev/null local exp_exit="$1"