From 7102c5cfd1bfa83ce3bbaf46c1b92d66ef579c07 Mon Sep 17 00:00:00 2001 From: "Goh, Wei Sheng" Date: Fri, 13 Jan 2023 14:14:49 +0800 Subject: [PATCH] script: Add an exception handling for binary file checking Changes List: - Add exception handling for binary file checking before test initiate Signed-off-by: Goh, Wei Sheng --- run.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/run.sh b/run.sh index ccb735f..adeb334 100755 --- a/run.sh +++ b/run.sh @@ -120,6 +120,23 @@ main() { exit fi + # Check for binary file for + if [[ "$CONFIG" == vs* && ! -e txrx-tsn ]]; then + echo "WARNING: TXRX-TSN not found!" + echo "WARNING: TXRX-TSN is needed for $CONFIG. Please ensure TXRX-TSN is compile during the build stage." + exit 1 + elif [[ "$CONFIG" == opcua* && ! -e opcua-server ]]; then + echo "WARNING: OPCUA-SERVER not found!" + echo "WARNING: OPCUA-SERVER is needed for $CONFIG. Please ensure OPCUA-SERVER is compile during the build stage." + exit 1 + elif [[ "$CONFIG" == tsq* && ! -e tsq ]]; then + echo "WARNING: TSQ not found!" + echo "WARNING: TSQ is needed for $CONFIG. Please ensure TSQ is compile during the build stage." + exit 1 + else + echo "" # Nothing + fi + # Only for debug: timesync per-run logging if [[ "$RUNSH_DEBUG_MODE" == "YES" && "$ACTION" == "run" ]]; then ts_log_start