summaryrefslogtreecommitdiffstats
path: root/test/test-functions
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2021-08-03 08:44:47 +0200
committerFranck Bui <fbui@suse.com>2021-08-18 17:37:55 +0200
commitdfd73ccb14e6839df7d8633984c382d01d630b3f (patch)
treeca8745ec0228f748f633a42bdf042ff907573206 /test/test-functions
parenttest: add support for NO_BUILD=1 on openSUSE (diff)
downloadsystemd-dfd73ccb14e6839df7d8633984c382d01d630b3f.tar.xz
systemd-dfd73ccb14e6839df7d8633984c382d01d630b3f.zip
test: don't try to find BUILD_DIR when NO_BUILD is set
NO_BUILD=1 indicates that we want to test systemd from the local system and not the one from the local build. Hence there should be no need to call find-build-dir.sh when NO_BUID=1 especially since it's likely that the script will fail to find a local build in this case. This avoids find-build-dir.sh to emit 'Specify build directory with $BUILD_DIR' message when NO_BUILD=1 and no local build can be found. This introduces a behavior change though: systemd from the local system will always be preferred when NO_BUILD=1 even if a local build can be found.
Diffstat (limited to '')
-rw-r--r--test/test-functions12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/test-functions b/test/test-functions
index 0dc8837e46..fe3081106f 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -83,13 +83,11 @@ TOOLS_DIR="$SOURCE_DIR/tools"
export TEST_BASE_DIR TEST_UNITS_DIR SOURCE_DIR TOOLS_DIR
# note that find-build-dir.sh will return $BUILD_DIR if provided, else it will try to find it
-if ! BUILD_DIR="$("$TOOLS_DIR"/find-build-dir.sh)"; then
- if get_bool "${NO_BUILD:=}"; then
- BUILD_DIR="$SOURCE_DIR"
- else
- echo "ERROR: no build found, please set BUILD_DIR or use NO_BUILD" >&2
- exit 1
- fi
+if get_bool "${NO_BUILD:=}"; then
+ BUILD_DIR="$SOURCE_DIR"
+elif ! BUILD_DIR="$("$TOOLS_DIR"/find-build-dir.sh)"; then
+ echo "ERROR: no build found, please set BUILD_DIR or use NO_BUILD" >&2
+ exit 1
fi
PATH_TO_INIT="$ROOTLIBDIR/systemd"