From 232add5c47a8486623c98158ed3a9a19f422b5d8 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Tue, 17 Nov 2020 15:55:47 -0500 Subject: [PATCH] test: allow run-integration-tests.sh to run without build --- test/README.testsuite | 8 ++++++++ test/run-integration-tests.sh | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/test/README.testsuite b/test/README.testsuite index a05a9936a69..da989c1e0d2 100644 --- a/test/README.testsuite +++ b/test/README.testsuite @@ -41,6 +41,14 @@ $ sudo make -C test/TEST-01-BASIC BUILD_DIR=../../some-other-build/ ... Note that in the second case, the path is relative to the test case directory. An absolute path may also be used in both cases. +Testing installed binaries instead of built +=========================================== + +To run the extended testsuite using the systemd installed on the system instead +of the systemd from a build, use the NO_BUILD=1: + +$ sudo NO_BUILD=1 test/run-integration-tests + Configuration variables ======================= diff --git a/test/run-integration-tests.sh b/test/run-integration-tests.sh index 219216ac566..34fa4f56a20 100755 --- a/test/run-integration-tests.sh +++ b/test/run-integration-tests.sh @@ -1,7 +1,15 @@ #!/usr/bin/env bash set -e -BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)" +if [ "$NO_BUILD" ]; then + BUILD_DIR="" +elif BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"; then + ninja -C "$BUILD_DIR" +else + echo "No build found, please set BUILD_DIR or NO_BUILD" >&2 + exit 1 +fi + if [ $# -gt 0 ]; then args="$@" else