Return the exit code from tox to callers of run_tests.sh

Invoking PIPESTATUS appears to be volatile in my environment,
after the if condition it is already again 0, even if it was
non-zero before. Capture the result permanently in a variable
and use that one consistently.

Also handle the just-pep8 case correctly.

Change-Id: Icca8c00c8d2189da1a133db277c9071c2d6c880b
This commit is contained in:
Dirk Mueller 2013-02-11 18:01:27 +01:00
parent bcaf6c4d93
commit 84b7969b72
1 changed files with 5 additions and 5 deletions

View File

@ -35,13 +35,13 @@ for arg in "$@"; do
done
if [ $just_pep8 -eq 1 ]; then
tox -e pep8
exit
exec tox -e pep8
fi
tox -e py27 $toxargs 2>&1 | tee run_tests.err.log || exit
if [ ${PIPESTATUS[0]} -ne 0 ]; then
exit ${PIPESTATUS[0]}
tox -e py27 $toxargs 2>&1 | tee run_tests.err.log || exit 1
tox_exit_code=${PIPESTATUS[0]}
if [ 0$tox_exit_code -ne 0 ]; then
exit $tox_exit_code
fi
if [ -z "$toxargs" ]; then