qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, joserz@linux.vnet.ibm.com,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [Qemu-devel] [RISU PATCH 9/9] new: run_risu.sh script
Date: Fri,  2 Dec 2016 15:59:35 +0000	[thread overview]
Message-ID: <20161202155935.3130-10-alex.bennee@linaro.org> (raw)
In-Reply-To: <20161202155935.3130-1-alex.bennee@linaro.org>

A simple script to work through running all of a bunch of files with
record/playback traces. Dumps a summary and the number of failed tests
at the end.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 run_risu.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100755 run_risu.sh

diff --git a/run_risu.sh b/run_risu.sh
new file mode 100755
index 0000000..8a91e1a
--- /dev/null
+++ b/run_risu.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# Run risu against a set of binaries + trace files
+#
+#
+#set -e
+
+passed=()
+failed=()
+missing=()
+
+script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
+risu_path=${script_dir}/risu
+
+for f in $@; do
+    t="$f.trace"
+    echo "Running $f against $t"
+    if [ -e $t ]; then
+        ${QEMU} ${risu_path} $f -t $t
+        if [ $? == 0 ]; then
+            passed=( "${passed[@]}" $f )
+        else
+            failed=( "${failed[@]}" $f )
+        fi
+    else
+        missing=( "${missing[@]}" $f )
+    fi
+done
+
+if test ${#missing[@]} -gt 0; then
+    echo "Tests missing ${#missing[@]} trace files:"
+    for m in "${missing[@]}"; do
+        echo "$m"
+    done
+fi
+
+if test ${#passed[@]} -gt 0; then
+    echo "Passed ${#passed[@]} tests:"
+    for p in "${passed[@]}"; do
+        echo "$p"
+    done
+fi
+
+if test ${#failed[@]} -gt 0; then
+    echo "Failed ${#failed[@]} tests:"
+    for f in "${failed[@]}"; do
+        echo "$f"
+    done
+fi
+
+exit ${#failed[@]}
-- 
2.10.2

  parent reply	other threads:[~2016-12-02 15:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 15:59 [Qemu-devel] [RISU PATCH 0/9] Record/playback patches Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 1/9] risu: a bit more verbosity when running Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 2/9] aarch64: add hand-coded risu skeleton for directed testing Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 3/9] risu: add simple trace and replay support Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 4/9] risu: add support compressed tracefiles Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 5/9] risu_aarch64: it's -> it is Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 6/9] risugen: remove grocer's apostrophe from REs Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 7/9] new: generate_all.sh script Alex Bennée
2016-12-02 15:59 ` [Qemu-devel] [RISU PATCH 8/9] new: record_traces.sh helper script Alex Bennée
2016-12-02 15:59 ` Alex Bennée [this message]
2016-12-05  9:50 ` [Qemu-devel] [RISU PATCH 0/9] Record/playback patches joserz

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=20161202155935.3130-10-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=joserz@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).