Add option to run_tests.sh to stop immediately on a failing test
This is a debugging convenience option, which makes it much easier to find the failing tests and fix them one by one. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
@@ -7,6 +7,7 @@ if [ -z "$CC" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export QUIET_TEST=1
|
export QUIET_TEST=1
|
||||||
|
STOP_ON_FAIL=0
|
||||||
|
|
||||||
export VALGRIND=
|
export VALGRIND=
|
||||||
VGCODE=126
|
VGCODE=126
|
||||||
@@ -24,6 +25,9 @@ base_run_test() {
|
|||||||
tot_pass=$((tot_pass + 1))
|
tot_pass=$((tot_pass + 1))
|
||||||
else
|
else
|
||||||
ret="$?"
|
ret="$?"
|
||||||
|
if [ "$STOP_ON_FAIL" -eq 1 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
if [ "$ret" -eq 1 ]; then
|
if [ "$ret" -eq 1 ]; then
|
||||||
tot_config=$((tot_config + 1))
|
tot_config=$((tot_config + 1))
|
||||||
elif [ "$ret" -eq 2 ]; then
|
elif [ "$ret" -eq 2 ]; then
|
||||||
@@ -595,7 +599,7 @@ utilfdt_tests () {
|
|||||||
run_test utilfdt_test
|
run_test utilfdt_test
|
||||||
}
|
}
|
||||||
|
|
||||||
while getopts "vt:m" ARG ; do
|
while getopts "vt:me" ARG ; do
|
||||||
case $ARG in
|
case $ARG in
|
||||||
"v")
|
"v")
|
||||||
unset QUIET_TEST
|
unset QUIET_TEST
|
||||||
@@ -606,6 +610,9 @@ while getopts "vt:m" ARG ; do
|
|||||||
"m")
|
"m")
|
||||||
VALGRIND="valgrind --tool=memcheck -q --error-exitcode=$VGCODE"
|
VALGRIND="valgrind --tool=memcheck -q --error-exitcode=$VGCODE"
|
||||||
;;
|
;;
|
||||||
|
"e")
|
||||||
|
STOP_ON_FAIL=1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user