]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/run-integration-tests.sh
tests: introduce dummy_server_init and use it in all journald fuzzers
[thirdparty/systemd.git] / test / run-integration-tests.sh
index 3ece46c7717599fe3b3987fd0e839d3b732242e6..0d2377128eb3948ca9a9a91b8dedb4aa15e99f20 100755 (executable)
@@ -1,21 +1,26 @@
 #!/bin/bash -e
 
-if ! test -d ../build ; then
-        echo "Expected build directory in ../build, but couldn't find it." >&2
-        exit 1
+BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"
+if [ $# -gt 0 ]; then
+        args="$@"
+else
+        args="clean setup run clean-again"
 fi
 
-ninja -C ../build
+ninja -C "$BUILD_DIR"
 
 declare -A results
 
-RESULT=0
+COUNT=0
 FAILURES=0
 
+cd "$(dirname "$0")"
 for TEST in TEST-??-* ; do
-        echo -e "\n--x-- Starting $TEST --x--"
+        COUNT=$(($COUNT+1))
+
+        echo -e "\n--x-- Running $TEST --x--"
         set +e
-        make -C "$TEST" BUILD_DIR=$(pwd)/../build clean setup run
+        ( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args )
         RESULT=$?
         set -e
         echo "--x-- Result of $TEST: $RESULT --x--"
@@ -37,9 +42,9 @@ for TEST in ${!results[@]}; do
 done | sort
 
 if [ "$FAILURES" -eq 0 ] ; then
-        echo -e "\nALL PASSED"
+        echo -e "\nALL $COUNT TESTS PASSED"
 else
-        echo -e "\nTOTAL FAILURES: $FAILURES"
+        echo -e "\nTOTAL FAILURES: $FAILURES OF $COUNT"
 fi
 
 exit "$FAILURES"