qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: Re: [PATCH] tests/decode: Convert tests to meson
Date: Wed, 24 May 2023 14:58:23 +0200	[thread overview]
Message-ID: <5a80a536-8893-57d1-d094-4582e1492b3c@redhat.com> (raw)
In-Reply-To: <20230523174848.682195-1-richard.henderson@linaro.org>

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



      reply	other threads:[~2023-05-24 12:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 17:48 [PATCH] tests/decode: Convert tests to meson Richard Henderson
2023-05-24 12:58 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a80a536-8893-57d1-d094-4582e1492b3c@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).