From: Laszlo Gombos Date: Wed, 19 Oct 2022 04:07:05 +0000 (+0000) Subject: test: only set basedir if it is not set by the invoker X-Git-Tag: 058~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d7508dc30fa4d29a3f44fa849ab87edae0b15b9;p=thirdparty%2Fdracut.git 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. --- 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() { : }