apparmor/utils/test/runtests-py3.sh
Christian Boltz ed1e2f3321 fix utils/test/runtests-py*.sh exitcode
utils/test/runtests-py*.sh always exits with $? = 1 even if there is no 
error. This is caused by the last executed command, test -n

This patch changes it to test -z so that we'll get $? = 0 if all tests 
succeed.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-10-03 11:48:21 +02:00

33 lines
823 B
Bash
Executable file

#!/bin/sh
# ------------------------------------------------------------------
#
# Copyright (C) 2014 Christian Boltz
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
test -z "$RUNTESTS_PY__PYTHON_BINARY" && RUNTESTS_PY__PYTHON_BINARY=python3
export PYTHONPATH=..
failed=""
for file in *.py ; do
echo "running $file..."
"$RUNTESTS_PY__PYTHON_BINARY" $file || {
failed="$failed $file"
echo "*** test $file failed - giving you some time to read the output... ***"
sleep 10
}
echo
done
test -z "$failed" || {
echo
echo "*** The following tests failed:"
echo "*** $failed"
exit 1
}