Skip to content

Commit

Permalink
update run_cmake_test to catch build errors and exit (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaMeixner-NOAA authored Mar 12, 2024
1 parent 156a46d commit 9d3799f
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions regtests/bin/run_cmake_test
Original file line number Diff line number Diff line change
Expand Up @@ -437,23 +437,24 @@ then
cat $path_build/switch >> $ofile
cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
if (( rc != 0 )); then
echo "Fatal error in cmake."
echo "The build log is in $ofile"
exit
echo "The build log is in ${ofile}"
exit ${rc}
fi
make -j 8 VERBOSE=1 >> $ofile 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
if (( rc != 0 )); then
echo "Fatal error in make."
echo "The build log is in $ofile"
exit
echo "The build log is in ${ofile}"
exit ${rc}
fi
make install >> $ofile 2>&1
if [[ $rc -ne 0 ]] ; then
rc=$?
if (( rc != 0 )); then
echo "Fatal error in make install."
echo "The build log is in $ofile"
exit
exit ${rc}
fi

cp $path_build/install/bin/* $path_e/
Expand All @@ -470,22 +471,24 @@ then
cat $path_build/switch >> $ofile
cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
if (( rc != 0 )); then
echo "Fatal error in cmake."
echo "The build log is in $ofile"
exit
echo "The build log is in ${ofile}"
exit ${rc}
fi
make -j 8 VERBOSE=1 >> $ofile 2>&1
if [[ $rc -ne 0 ]] ; then
rc=$?
if (( rc != 0 )); then
echo "Fatal error in make."
echo "The build log is in $ofile"
exit
echo "The build log is in ${ofile}"
exit ${rc}
fi
make install >> $ofile 2>&1
if [[ $rc -ne 0 ]] ; then
rc=$?
if (( rc != 0 )); then
echo "Fatal error in make install."
echo "The build log is in $ofile"
exit
exit ${rc}
fi
path_e=$path_w/exe
cp $path_build/install/bin/ww3_shel $path_e/
Expand All @@ -509,22 +512,24 @@ else
cat $path_build/switch >> $ofile
cmake $path_cmake ${CMAKE_OPTIONS} -DSWITCH=$path_build/switch -DCMAKE_INSTALL_PREFIX=install >> $ofile 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
if (( rc != 0 )); then
echo "Fatal error in cmake."
echo "The build log is in $ofile"
exit
echo "The build log is in ${ofile}"
exit ${rc}
fi
make -j 8 VERBOSE=1 >> $ofile 2>&1
if [[ $rc -ne 0 ]] ; then
rc=$?
if (( rc != 0 )); then
echo "Fatal error in make."
echo "The build log is in $ofile"
exit
echo "The build log is in ${ofile}"
exit ${rc}
fi
make install >> $ofile 2>&1
if [[ $rc -ne 0 ]] ; then
echo "Fatal error in make install."
echo "The build log is in $ofile"
exit
rc=$?
if (( rc != 0 )); then
echo "Fatal error in make."
echo "The build log is in ${ofile}"
exit ${rc}
fi

cp $path_build/install/bin/* $path_e/
Expand Down

0 comments on commit 9d3799f

Please sign in to comment.