Skip to content

Commit

Permalink
Handle CTest exit status correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Oct 30, 2024
1 parent 42f8599 commit a8b3a37
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
displayName: Cache Python Libraries

- bash: |
set -eu -o pipefail
set -o nounset errexit pipefail
cat /proc/cpuinfo | grep "model name" | sort -u
df -h
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
Expand Down Expand Up @@ -146,37 +146,36 @@ jobs:
displayName: 'Install dependencies'
- bash: |
set -eu -o pipefail
# set options
set -o nounset errexit pipefail
# display disk space usage
df -h
# configure
export AMReX_CMAKE_FLAGS="-DAMReX_ASSERTIONS=ON -DAMReX_TESTING=ON"
cmake -S . -B build \
${AMReX_CMAKE_FLAGS} \
${WARPX_CMAKE_FLAGS} \
-DWarpX_TEST_CLEANUP=ON \
-DWarpX_TEST_FPETRAP=ON
# build
cmake --build build -j 2
# display disk space usage
df -h
displayName: 'Build'
- bash: |
set -eu -o pipefail
# set options
set -o nounset errexit pipefail
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
ctest_exit_status=$?
displayName: 'Test'
# find and print backtraces (regardless of CTest exit status)
- bash: |
# set options
set -o nounset errexit pipefail
# find and print backtrace
find build/bin/ -type f -name "Backtrace*" \
-exec echo -e "\nBacktrace\n---------\n{}\n---------" \; \
-exec cat {} \; \
-exec echo -e "\n" \;
# exit program based on CTest exit status
if (( ${ctest_exit_status} != 0 )); then
exit ${ctest_exit_status}
fi
displayName: 'Test'
-exec echo -e "\nBacktrace\n---------\n{}\n---------" \; \
-exec cat {} \;
displayName: 'Logs'
condition: always()

0 comments on commit a8b3a37

Please sign in to comment.