summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-07 09:07:40 +0100
committerGitHub <noreply@github.com>2017-12-07 09:07:40 +0100
commitea781d0dd81a0f7dbc9b7e51b7c4b996b7d5171b (patch)
tree854c5eb3f8c62229a542dc19c30ef206995c89f8 /test
parent43a29e2b65e13500a2ce60ed41d2f57ba3bc22ad (diff)
parent2535f23dd843c8abf3b53f752057e53950896f80 (diff)
downloadsystemd-ea781d0dd81a0f7dbc9b7e51b7c4b996b7d5171b.tar.gz
systemd-ea781d0dd81a0f7dbc9b7e51b7c4b996b7d5171b.tar.bz2
systemd-ea781d0dd81a0f7dbc9b7e51b7c4b996b7d5171b.zip
Merge pull request #7554 from keszybz/autodetect-build
Autodetect build directory ignoring mkosi artefacts
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.guess14
-rw-r--r--test/TEST-01-BASIC/Makefile2
-rw-r--r--test/TEST-13-NSPAWN-SMOKE/Makefile2
-rw-r--r--test/TEST-17-UDEV-WANTS/Makefile2
-rw-r--r--test/TEST-18-FAILUREACTION/Makefile2
-rw-r--r--test/TEST-19-DELEGATE/Makefile2
-rwxr-xr-xtest/run-integration-tests.sh13
7 files changed, 13 insertions, 24 deletions
diff --git a/test/Makefile.guess b/test/Makefile.guess
deleted file mode 100644
index 1916d09a6c..0000000000
--- a/test/Makefile.guess
+++ /dev/null
@@ -1,14 +0,0 @@
-# Try to guess the build directory:
-# we look for subdirectories of ../.. that look like ninja build dirs.
-
-ifeq ($(BUILD_DIR),)
- dirs = $(dir $(wildcard ../../*/.ninja_log))
- ifeq ($(dirs),)
- $(error Cannot guess build dir, set BUILD_DIR)
- endif
- ifneq ($(firstword $(dirs)),$(dirs))
- $(warning Candidates: $(dirs))
- $(error Too many build dirs to pick from, set BUILD_DIR)
- endif
- BUILD_DIR=$(dirs)
-endif
diff --git a/test/TEST-01-BASIC/Makefile b/test/TEST-01-BASIC/Makefile
index b895de8bcb..3a212a07a9 100644
--- a/test/TEST-01-BASIC/Makefile
+++ b/test/TEST-01-BASIC/Makefile
@@ -1,4 +1,4 @@
-include ../Makefile.guess
+BUILD_DIR=$(exec ../../tools/find-build-dir.sh)
all setup clean run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
diff --git a/test/TEST-13-NSPAWN-SMOKE/Makefile b/test/TEST-13-NSPAWN-SMOKE/Makefile
index 41cca23c7f..ddcbbc302f 100644
--- a/test/TEST-13-NSPAWN-SMOKE/Makefile
+++ b/test/TEST-13-NSPAWN-SMOKE/Makefile
@@ -1,4 +1,4 @@
-include ../Makefile.guess
+BUILD_DIR=$(exec ../../tools/find-build-dir.sh)
all setup run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
diff --git a/test/TEST-17-UDEV-WANTS/Makefile b/test/TEST-17-UDEV-WANTS/Makefile
index b895de8bcb..3a212a07a9 100644
--- a/test/TEST-17-UDEV-WANTS/Makefile
+++ b/test/TEST-17-UDEV-WANTS/Makefile
@@ -1,4 +1,4 @@
-include ../Makefile.guess
+BUILD_DIR=$(exec ../../tools/find-build-dir.sh)
all setup clean run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
diff --git a/test/TEST-18-FAILUREACTION/Makefile b/test/TEST-18-FAILUREACTION/Makefile
index b895de8bcb..3a212a07a9 100644
--- a/test/TEST-18-FAILUREACTION/Makefile
+++ b/test/TEST-18-FAILUREACTION/Makefile
@@ -1,4 +1,4 @@
-include ../Makefile.guess
+BUILD_DIR=$(exec ../../tools/find-build-dir.sh)
all setup clean run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
diff --git a/test/TEST-19-DELEGATE/Makefile b/test/TEST-19-DELEGATE/Makefile
index b895de8bcb..3a212a07a9 100644
--- a/test/TEST-19-DELEGATE/Makefile
+++ b/test/TEST-19-DELEGATE/Makefile
@@ -1,4 +1,4 @@
-include ../Makefile.guess
+BUILD_DIR=$(exec ../../tools/find-build-dir.sh)
all setup clean run:
@basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh
index 3ece46c771..7d70be3fea 100755
--- a/test/run-integration-tests.sh
+++ b/test/run-integration-tests.sh
@@ -1,21 +1,24 @@
#!/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"
fi
-ninja -C ../build
+ninja -C "$BUILD_DIR"
declare -A results
RESULT=0
FAILURES=0
+cd "$(dirname "$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
+ make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args
RESULT=$?
set -e
echo "--x-- Result of $TEST: $RESULT --x--"