Simplify the tests script
This commit is contained in:
parent
b613644fea
commit
fc603d7795
|
@ -26,24 +26,12 @@ DATE="date"
|
||||||
#fail
|
#fail
|
||||||
_fail()
|
_fail()
|
||||||
{
|
{
|
||||||
test="$1"
|
_run "$@"
|
||||||
|
|
||||||
shift
|
|
||||||
echo -n "$test:" 1>&2
|
|
||||||
(echo
|
|
||||||
echo "Testing: $OBJDIR$test" "$@"
|
|
||||||
LD_LIBRARY_PATH="$OBJDIR../src" "$OBJDIR$test" "$@") >> "$target" 2>&1
|
|
||||||
res=$?
|
|
||||||
if [ $res -ne 0 ]; then
|
|
||||||
echo " FAILED (error $res)" 1>&2
|
|
||||||
else
|
|
||||||
echo " PASS" 1>&2
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#test
|
#run
|
||||||
_test()
|
_run()
|
||||||
{
|
{
|
||||||
test="$1"
|
test="$1"
|
||||||
|
|
||||||
|
@ -54,13 +42,24 @@ _test()
|
||||||
LD_LIBRARY_PATH="$OBJDIR../src" "$OBJDIR$test" "$@") >> "$target" 2>&1
|
LD_LIBRARY_PATH="$OBJDIR../src" "$OBJDIR$test" "$@") >> "$target" 2>&1
|
||||||
res=$?
|
res=$?
|
||||||
if [ $res -ne 0 ]; then
|
if [ $res -ne 0 ]; then
|
||||||
echo " FAILED" 1>&2
|
echo "Test: $test$sep$@: FAIL (error $res)"
|
||||||
FAILED="$FAILED $test(error $res)"
|
echo " FAIL"
|
||||||
return 2
|
|
||||||
else
|
else
|
||||||
echo " PASS" 1>&2
|
echo "Test: $test$sep$@: PASS"
|
||||||
return 0
|
echo " PASS"
|
||||||
fi
|
fi
|
||||||
|
return $res
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#test
|
||||||
|
_test()
|
||||||
|
{
|
||||||
|
test="$1"
|
||||||
|
|
||||||
|
_run "$@"
|
||||||
|
res=$?
|
||||||
|
[ $res -eq 0 ] || FAILED="$FAILED $test(error $res)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user