diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2017-06-21 16:42:44 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-06-29 12:12:02 +0100 |
commit | 273dae30ef85746e78eb60b627ab1049bd0eab97 (patch) | |
tree | c90aad2b779d42875a7433639bb734bd337d5af9 | |
parent | 993043f7ce4a7fa7d7f0dc61ffdce8156de0645b (diff) |
new: run_risu.sh script
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>
Message-id: 20170621154244.28309-11-alex.bennee@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rwxr-xr-x | contrib/run_risu.sh | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/contrib/run_risu.sh b/contrib/run_risu.sh new file mode 100755 index 0000000..439cd36 --- /dev/null +++ b/contrib/run_risu.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# Run risu against a set of binaries + trace files +# +# Copyright (c) 2017 Linaro Limited +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Alex Bennée <alex.bennee@linaro.org> - initial implementation +# +# Usage: +# (optional) export QEMU=/path/to/qemu +# (optional) export RISU=/path/to/risu +# ./run_risu.sh ./testcases.aarch64/*.bin + +set -e + +passed=() +failed=() +missing=() + +if test -z "$RISU"; then + script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) + RISU=${script_dir}/risu +fi + +for f in $@; do + t="$f.trace" + echo "Running $f against $t" + if [ -e $t ]; then + ${QEMU} ${RISU} $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[@]} |