mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 10:13:34 +08:00
test: add a simple script that runs all our integration tests one after the other
This commit is contained in:
parent
9b45c2bf02
commit
8fe9c8d920
45
test/run-integration-tests.sh
Executable file
45
test/run-integration-tests.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
if ! test -d ../build ; then
|
||||
echo "Expected build directory in ../build, but couldn't find it." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ninja -C ../build
|
||||
|
||||
declare -A results
|
||||
|
||||
RESULT=0
|
||||
FAILURES=0
|
||||
|
||||
for TEST in TEST-??-* ; do
|
||||
echo -e "\n--x-- Starting $TEST --x--"
|
||||
set +e
|
||||
make -C "$TEST" BUILD_DIR=$(pwd)/../build clean setup run
|
||||
RESULT=$?
|
||||
set -e
|
||||
echo "--x-- Result of $TEST: $RESULT --x--"
|
||||
|
||||
results["$TEST"]="$RESULT"
|
||||
|
||||
[ "$RESULT" -ne "0" ] && FAILURES=$(($FAILURES+1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
|
||||
for TEST in ${!results[@]}; do
|
||||
RESULT="${results[$TEST]}"
|
||||
if [ "$RESULT" -eq "0" ] ; then
|
||||
echo "$TEST: SUCCESS"
|
||||
else
|
||||
echo "$TEST: FAIL"
|
||||
fi
|
||||
done | sort
|
||||
|
||||
if [ "$FAILURES" -eq 0 ] ; then
|
||||
echo -e "\nALL PASSED"
|
||||
else
|
||||
echo -e "\nTOTAL FAILURES: $FAILURES"
|
||||
fi
|
||||
|
||||
exit "$FAILURES"
|
Loading…
Reference in New Issue
Block a user