[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests/decode: Convert tests to meson
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] tests/decode: Convert tests to meson |
Date: |
Wed, 24 May 2023 14:58:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 |
On 5/23/23 19:48, Richard Henderson wrote:
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
Hi Paolo, I've used "should_fail: true" because from the docs that
seems like the proper thing, but that produces
28/39 qemu:decodetree / err_width1 EXPECTEDFAIL 0.08s exit status 1
which isn't nearly so reassuring as OK. I wonder if it would be better
to add a --test-fail switch to decodetree.py, to invert the exit value?
Yeah, the documentation is incorrect and it would need a
success_exitcode argument or something like that. Maybe it's easier to
change the shell script to emit TAP, and use
protocol: 'tap', verbose: true
in the test() invocation?
Should be as easy as
--- a/tests/decode/check.sh
+++ b/tests/decode/check.sh
@@ -1,24 +1,29 @@
-#!/bin/sh
+#!/bin/bash
# This work is licensed under the terms of the GNU LGPL, version 2 or later.
# See the COPYING.LIB file in the top-level directory.
PYTHON=$1
DECODETREE=$2
-E=0
+j=0
# All of these tests should produce errors
for i in err_*.decode; do
+ let j++
if $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then
# Pass, aka failed to fail.
- echo FAIL: $i 1>&2
- E=1
+ echo not ok $j $i
+ else
+ echo ok $j $i
fi
done
for i in succ_*.decode; do
- if ! $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then
- echo FAIL:$i 1>&2
+ let j++
+ if $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then
+ echo ok $j $i
+ else
+ echo not ok $j $i
fi
done
-exit $E
+echo 1..$j