summaryrefslogtreecommitdiff
path: root/test/run-integration-tests.sh
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-31 12:11:14 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-31 14:37:20 +0200
commit73abf7ae06a8699e8104cc7d97b5980245ecf04d (patch)
tree1f4c0a831d67f1551888d7299e0da00ef9e95751 /test/run-integration-tests.sh
parent6e5b51d94a1c87bd3decf0fa1e557f60a9b52017 (diff)
downloadsystemd-73abf7ae06a8699e8104cc7d97b5980245ecf04d.tar.gz
run-integration-tests: only do the clean operation in the beginning
When doing 'make clean', we remove the cached image. So doing 'make -C TEST-NN-foo clean setup run clean-again' in a loop is very slow. Let's filter out the 'clean' target (if specified), and do the cleaning in the beginning, and then run other targets in a loop as before.
Diffstat (limited to 'test/run-integration-tests.sh')
-rwxr-xr-xtest/run-integration-tests.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh
index 2435e1894e..ac7a28cf2c 100755
--- a/test/run-integration-tests.sh
+++ b/test/run-integration-tests.sh
@@ -4,11 +4,11 @@ set -e
BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"
if [ $# -gt 0 ]; then
args="$@"
- do_clean=0
else
args="setup run clean-again"
- do_clean=1
fi
+args_no_clean=$(sed -r 's/(^| )clean($| )/ /g' <<<$args)
+do_clean=$( [ "$args" = "$args_no_clean" ]; echo $? )
ninja -C "$BUILD_DIR"
@@ -20,6 +20,8 @@ FAILURES=0
cd "$(dirname "$0")"
+# Let's always do the cleaning operation first, because it destroys the image
+# cache.
if [ $do_clean = 1 ]; then
for TEST in TEST-??-* ; do
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean )
@@ -44,7 +46,7 @@ for TEST in TEST-??-* ; do
echo -e "\n--x-- Running $TEST --x--"
set +e
- ( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args )
+ ( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args_no_clean )
RESULT=$?
set -e
echo "--x-- Result of $TEST: $RESULT --x--"