[LTP] [RFC PATCH 1/3] tst_test.sh: Add $LTPROOT/testcases/bin into PATH

Petr Vorel pvorel@suse.cz
Tue Jun 15 18:33:05 CEST 2021


when LTPROOT set. Also TWARN when directory does not exist.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_test.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 8b4e9cb60..970eca7d1 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -697,6 +697,10 @@ if [ -z "$LTPROOT" ]; then
 	export LTPROOT="$PWD"
 	export TST_DATAROOT="$LTPROOT/datafiles"
 else
+	if [ ! -d "$LTPROOT/testcases/bin" ]; then
+		tst_res TWARN "$LTPROOT/testcases/bin does not exist, is \$LTPROOT properly set?"
+	fi
+	export PATH="$LTPROOT/testcases/bin:$PATH"
 	export TST_DATAROOT="$LTPROOT/testcases/data/$TST_ID"
 fi
 
-- 
2.32.0



More information about the ltp mailing list