diff --git a/ci/common/build.bash b/ci/common/build.bash index 9a897e9cb9..46054c4acd 100755 --- a/ci/common/build.bash +++ b/ci/common/build.bash @@ -289,8 +289,13 @@ set -e log "Test Thrust and CUB..." -echo_and_run_timed "Test" ctest ${CTEST_FLAGS} | tee ctest_log -test_status=$? +( + # Make sure test_status captures ctest, not tee: + # https://stackoverflow.com/a/999259/11130318 + set -o pipefail + echo_and_run_timed "Test" ctest ${CTEST_FLAGS} | tee ctest_log + test_status=$? +) ################################################################################ # COMPILE TIME INFO: Print the 20 longest running build steps (ninja only)