Fix run_tests.sh usage of tools/colorizer.py.

* run_tests.sh: tools/colorizer.py expects subunit v1 and not v2.
Convert the subunit stream to v1 if subunit-2to1 is present (this
indicates v2 of subunit is being used) before passing the output on to
tools/colorizer.py.

Fixes bug #1168516

Change-Id: I6be917181fa8d18764db89e741190964546d0632
This commit is contained in:
Clark Boylan
2013-04-22 19:53:25 -07:00
parent bfc3a3ccb2
commit 7f262c5ae2
+8 -1
View File
@@ -137,7 +137,14 @@ function run_tests {
testrargs=`echo "$testrargs" | sed -e's/^\s*\(.*\)\s*$/\1/'`
TESTRTESTS="$TESTRTESTS --testr-args='--subunit $testropts $testrargs'"
echo "Running \`${wrapper} $TESTRTESTS\`"
bash -c "${wrapper} $TESTRTESTS | ${wrapper} tools/colorizer.py"
if ${wrapper} which subunit-2to1 2>&1 > /dev/null
then
# subunit-2to1 is present, testr subunit stream should be in version 2
# format. Convert to version one before colorizing.
bash -c "${wrapper} $TESTRTESTS | ${wrapper} subunit-2to1 | ${wrapper} tools/colorizer.py"
else
bash -c "${wrapper} $TESTRTESTS | ${wrapper} tools/colorizer.py"
fi
RESULT=$?
set -e