On 5/25/23 03:00, Peter Maydell wrote:
On Wed, 24 May 2023 at 18:38, Richard Henderson
<richard.hender...@linaro.org> wrote:

We currently print FAIL for the failure of a succ_* test, but don't
return a failure exit code.  Instead, convert the script to emit
Test Anything Protocol, which gives visibility into each subtest
as well as not relying on exit codes.

Suggested-by: Paolo Bonzini <pbonz...@redhat.com>
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
  tests/decode/check.sh | 36 ++++++++++++++++++++++++++----------
  tests/meson.build     |  1 +
  2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/tests/decode/check.sh b/tests/decode/check.sh
index 95445a0115..a3d879a099 100755
--- a/tests/decode/check.sh
+++ b/tests/decode/check.sh
@@ -4,21 +4,37 @@

  PYTHON=$1
  DECODETREE=$2
-E=0
+E_FILES=`echo err_*.decode`
+S_FILES=`echo succ_*.decode`

If you run shellcheck on this script it produces some
style complaints. Notably:

  * $(...) is better than `...`
  * j=$(($j + 1))  is better than j=`expr $j + 1`

At least some of its "missing quoting" complaints are
also legitimate, notably on $PYTHON and $DECODETREE.

"Better" in what sense? Also, this is /bin/sh, not /bin/bash, so I'm never certain what I'm really allowed to use.

I was already half tempted to convert the script to python anyway...


r~


Reply via email to