From 2d7508dc30fa4d29a3f44fa849ab87edae0b15b9 Mon Sep 17 00:00:00 2001 From: Laszlo Gombos Date: Wed, 19 Oct 2022 04:07:05 +0000 Subject: [PATCH] test: only set basedir if it is not set by the invoker Set basedir in test-functions instead of Makefile. This change will allow to use a different basedir without modifying Makefiles. --- test/Makefile.testdir | 8 ++++---- test/test-functions | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/Makefile.testdir b/test/Makefile.testdir index 5757d0ce8..64e0d4964 100644 --- a/test/Makefile.testdir +++ b/test/Makefile.testdir @@ -2,11 +2,11 @@ all: @$(MAKE) -s --no-print-directory -C ../.. all - @V=$(V) basedir="$(realpath ../..)" testdir="$(realpath ../)" ./test.sh --all + @V=$(V) testdir="$(realpath ../)" ./test.sh --all setup: @$(MAKE) --no-print-directory -C ../.. all - @basedir="$(realpath ../..)" testdir="$(realpath ../)" ./test.sh --setup + @testdir="$(realpath ../)" ./test.sh --setup clean: - @basedir="$(realpath ../..)" testdir="$(realpath ../)" ./test.sh --clean + @testdir="$(realpath ../)" ./test.sh --clean run: - @basedir="$(realpath ../..)" testdir="$(realpath ../)" ./test.sh --run + @testdir="$(realpath ../)" ./test.sh --run diff --git a/test/test-functions b/test/test-functions index f2896a914..d81e9ad01 100644 --- a/test/test-functions +++ b/test/test-functions @@ -10,6 +10,8 @@ fi echo "TESTDIR=\"$TESTDIR\"" > .testdir${TEST_RUN_ID:+-$TEST_RUN_ID} export TESTDIR +if [[ -z $basedir ]]; then basedir="$(realpath ../..)"; fi + command -v test_check &> /dev/null || test_check() { : } -- 2.47.3