mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
test: Move test support files to separate dir and keep tests in /test
Signed-off-by: Jacques de Laval <jacques@de-laval.se>
This commit is contained in:
1 parent
4aa17a84ab
commit
7fe1189f7b
15 files changed
+62
-65
No files matched your search
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
cmd=""
|
||||
if [ "$#" -lt 1 ]; then
|
||||
cmd="/bin/sh"
|
||||
else
|
||||
cmd=$1
|
||||
shift
|
||||
fi
|
||||
|
||||
TEST_DIR=$(dirname "$0")/..
|
||||
TENV_ROOT="${TENV_ROOT:-$(pwd)/${TEST_DIR}/tenv-root}"
|
||||
PID_FILE="$TENV_ROOT/running_test.pid"
|
||||
|
||||
if [ -f "$PID_FILE" ] ; then
|
||||
target=$(cat "$PID_FILE")
|
||||
target=$(pgrep -P "$target")
|
||||
else
|
||||
echo "No test running!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$TEST_DIR/test.env"
|
||||
|
||||
"$(dirname "$0")"/exec.sh "$target" "$cmd" "$@"
|
||||
Reference in new issue
Block a user