From 053c8d0e5560e9288cc38158edfcdb41eb414a45 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Mon, 6 Jan 2020 08:06:38 +0100 Subject: [PATCH] Exit prematurely if certain commands fail. --- worker/build_rostests | 8 ++++---- worker/run_rostests | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/worker/build_rostests b/worker/build_rostests index 67b6073..89696d9 100644 --- a/worker/build_rostests +++ b/worker/build_rostests @@ -7,15 +7,15 @@ REVISION_SUFFIX=`cat revision_suffix` export ROSTESTS_INSTALL="${ROSTESTS_PREFIX}-${REVISION_SUFFIX}" rm -rf $ROSTESTS_INSTALL -mkdir $ROSTESTS_INSTALL +mkdir -p $ROSTESTS_INSTALL -../../configure -DENABLE_ROSTESTS=1 +../../configure -DENABLE_ROSTESTS=1 || exit $? cd $ROS_OUTPUT -ninja rostests_install +ninja rostests_install || exit $? # The directory at ROSTESTS_INSTALL shall only contain the test executables to run, but not rosautotest.exe itself. # This is why "ninja rostests_install" only builds and copies test executables, and we need to run "ninja rosautotest" to also get rosautotest built. # However, we then need to copy rosautotest.exe somewhere for the "run_rostests" script (which may be run on a different machine). ROSTESTS_INSTALL is the only option here. # "run_rostests" will then move rosautotest.exe out of that directory to its final location. -ninja rosautotest +ninja rosautotest || exit $? cp modules/rostests/rosautotest/rosautotest.exe $ROSTESTS_INSTALL diff --git a/worker/run_rostests b/worker/run_rostests index e314891..888caec 100644 --- a/worker/run_rostests +++ b/worker/run_rostests @@ -6,9 +6,9 @@ source ../../config.inc rm -rf "${ROSAUTOTEST_DIR}" -mv "${ROSTESTS_PREFIX}-$1" "${ROSAUTOTEST_DIR}" +mv "${ROSTESTS_PREFIX}-$1" "${ROSAUTOTEST_DIR}" || exit $? cd $WORKDIR -mv ${ROSAUTOTEST_DIR}/rosautotest.exe . -cp $SOURCEDIR/../rosautotest.ini . +mv ${ROSAUTOTEST_DIR}/rosautotest.exe . || exit $? +cp $SOURCEDIR/../rosautotest.ini . || exit $? ./rosautotest.exe /c "Build $1" /w