From c280b46823a155418bf20317e5778e0a77480174 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Thu, 4 Sep 2014 11:54:38 -0400 Subject: [PATCH] benchs: produce .xml files conform with junit Signed-off-by: Jean Privat --- benchmarks/bench_common.sh | 11 ++++++++++- benchmarks/bench_engines.sh | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/benchmarks/bench_common.sh b/benchmarks/bench_common.sh index c600732..4ea5ffe 100644 --- a/benchmarks/bench_common.sh +++ b/benchmarks/bench_common.sh @@ -37,9 +37,11 @@ function bench_command() echo "** [$title] $desc **" echo " $ $@" + failed= + # Execute the commands $count times for i in `seq 1 "$count"`; do - /usr/bin/time -f "%U" -o "$timeout" -a "$@" > $outputopts 2>&1 || die "$1: failed" + /usr/bin/time -f "%U" -o "$timeout" -a "$@" > $outputopts 2>&1 || { failed=true; die "$1: failed"; } echo -n "$i. " tail -n 1 "$timeout" done @@ -47,6 +49,13 @@ function bench_command() line=`compute_stats "$timeout"` echo "$line ($res)" echo $line >> "$res" + + test -z "$xml" && return + echo >>"$xml" "" + if test -n "$failed"; then + echo >>"$xml" "" + fi + echo >>"$xml" "" } # Run a simble command witout storing the execution time diff --git a/benchmarks/bench_engines.sh b/benchmarks/bench_engines.sh index 3737424..385d033 100755 --- a/benchmarks/bench_engines.sh +++ b/benchmarks/bench_engines.sh @@ -103,6 +103,9 @@ while [ "$stop" = false ]; do esac done +xml="bench_engines.xml" +echo "" > "$xml" + NOTSKIPED="$*" if test -z "$NOTSKIPED"; then @@ -332,6 +335,8 @@ if test -n "$html"; then echo >>"$html" "" fi +echo >>"$xml" "" + if test -n "$died"; then echo "Some commands failed" exit 1 -- 1.7.9.5