Exit prematurely if certain commands fail.

This commit is contained in:
Colin Finck 2020-01-06 08:06:38 +01:00
parent ce46f5709b
commit 053c8d0e55
No known key found for this signature in database
GPG Key ID: 1BA74E70456BA1A9
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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