Skip to content

Commit

Permalink
Make ctest always print output on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
lrstewart committed Jun 13, 2023
1 parent b4aee0c commit aa71423
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/s2n_bsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# permissions and limitations under the License.
#
set -eu
export CTEST_OUTPUT_ON_FAILURE=1

# FreeBSD and OpenBSD have different ways of getting CPU count
# see https://serverfault.com/questions/203207/how-do-i-count-the-number-of-processors-on-an-openbsd-system
Expand Down
1 change: 0 additions & 1 deletion .github/s2n_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
set -eu
source codebuild/bin/s2n_setup_env.sh

export CTEST_OUTPUT_ON_FAILURE=1
BREWINSTLLPATH=$(brew --prefix [email protected])
OPENSSL_1_1_1_INSTALL_DIR="${BREWINSTLLPATH:-"/usr/local/Cellar/[email protected]/1.1.1?"}"

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ if (BUILD_TESTING)
add_library(allocator_overrides SHARED ${TEST_LD_PRELOAD})

set(UNIT_TEST_ENVS S2N_DONT_MLOCK=1)
set(UNIT_TEST_ENVS ${UNIT_TEST_ENVS} CTEST_OUTPUT_ON_FAILURE=1)
if(TSAN)
set(TSAN_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/tests/.tsan_suppressions)
if(NOT EXISTS ${TSAN_SUPPRESSIONS_FILE})
Expand Down
6 changes: 3 additions & 3 deletions codebuild/bin/s2n_codebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ run_integration_v2_tests() {
cd ./build/
for test_name in $TOX_TEST_NAME; do
test="${test_name//test_/}"
echo "Running... ctest --no-tests=error --output-on-failure --verbose -R ^integrationv2_${test}$"
ctest --no-tests=error --output-on-failure --verbose -R ^integrationv2_${test}$
echo "Running... ctest --no-tests=error --verbose -R ^integrationv2_${test}$"
ctest --no-tests=error --verbose -R ^integrationv2_${test}$
done
}

Expand All @@ -120,7 +120,7 @@ run_unit_tests() {
-DEXPERIMENTAL_TREAT_WARNINGS_AS_ERRORS=on
cmake --build ./build -- -j $(nproc)
test_linked_libcrypto ./build/bin/s2nc
cmake --build build/ --target test -- ARGS="-L unit --output-on-failure -j $(nproc)"
cmake --build build/ --target test -- ARGS="-L unit -j $(nproc)"
}

# Run Multiple tests on one flag.
Expand Down
2 changes: 1 addition & 1 deletion codebuild/bin/s2n_codebuild_al2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi
case "$TESTS" in
"unit") cmake . -Bbuild -DCMAKE_EXE_LINKER_FLAGS="-lcrypto -lz" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -D${CMAKE_PQ_OPTION} -DS2N_BLOCK_NONPORTABLE_OPTIMIZATIONS=True
cmake --build ./build -j $(nproc)
cmake --build ./build --target test -- ARGS="-L unit --output-on-failure"
cmake --build ./build --target test -- ARGS="-L unit"
;;
*) echo "Unknown test"
exit 1;;
Expand Down
2 changes: 1 addition & 1 deletion codebuild/spec/buildspec_tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ phases:
post_build:
on-failure: ABORT
commands:
- CTEST_OUTPUT_ON_FAILURE=1 CTEST_PARALLEL_LEVEL=$(nproc) make -C build test
- CTEST_PARALLEL_LEVEL=$(nproc) make -C build test
2 changes: 1 addition & 1 deletion codebuild/spec/buildspec_unit_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ phases:
post_build:
on-failure: ABORT
commands:
- LLVM_PROFILE_FILE="ut_%p.profraw" CTEST_PARALLEL_LEVEL=$(nproc) cmake --build ./build --target test ARGS="--output-on-failure -L unit"
- LLVM_PROFILE_FILE="ut_%p.profraw" CTEST_PARALLEL_LEVEL=$(nproc) cmake --build ./build --target test ARGS="-L unit"
- $CB_BIN_DIR/coverage_report.sh
- $CB_BIN_DIR/coverage_upload.sh

0 comments on commit aa71423

Please sign in to comment.