Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Runner/init_env
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,25 @@ if [ -z "$ROOT_DIR" ]; then
fi
fi

if [ ! -d "$ROOT_DIR/utils" ] || [ ! -f "$ROOT_DIR/utils/functestlib.sh" ]; then
echo "[ERROR] Could not detect testkit root (missing utils/ or functestlib.sh)" >&2
# --- Validate and export key environment paths ---
if [ -z "${ROOT_DIR:-}" ] || [ ! -d "$ROOT_DIR/utils" ] || [ ! -f "$ROOT_DIR/utils/functestlib.sh" ]; then
echo "[ERROR] Could not detect testkit root (missing utils/ or functestlib.sh)" >&2
exit 1
fi

export ROOT_DIR
export TOOLS="$ROOT_DIR/utils"
export __RUNNER_SUITES_DIR="$ROOT_DIR/suites"
export __RUNNER_UTILS_BIN_DIR="$ROOT_DIR/common"

# --- Ensure TOOLS is usable in all shells ---
case ":$PATH:" in
*":$TOOLS:"*) : ;;
*) PATH="$TOOLS:$PATH"; export PATH ;;
esac

# --- Optional: pre-check for required tools (safe no-op for minimal builds) ---
if [ -f "$TOOLS/functestlib.sh" ]; then
# shellcheck disable=SC1090,SC1091
. "$TOOLS/functestlib.sh" >/dev/null 2>&1 || true
fi
Loading
Loading