Skip to content

cmake: Enable CTEST_OUTPUT_ON_FAILURE to show corelibs-foundation test failure #20314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -3181,6 +3181,7 @@ for host in "${ALL_HOSTS[@]}"; do
)

[[ -z "${DISTCC}" ]] || EXTRA_DISTCC_OPTIONS=("DISTCC_HOSTS=localhost,lzo,cpp")
export CTEST_OUTPUT_ON_FAILURE=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spevans This is going to export it for the rest of build-script-impl's invocation. I think it may cause weird confusion for people unless it is put in global scope at the top of build-script-impl with a nice comment. That or put it on the actual test command for Foundation below.

Can you make that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gottesmm I did originally try and enable it in swift-corelibs-foundation's cmake config but could not get it to work, does the following look ok?

index e7bf8f734b..0d619392fc 100755
--- a/utils/build-script-impl
+++ b/utils/build-script-impl
@@ -2853,6 +2853,10 @@ for host in "${ALL_HOSTS[@]}"; do
     # Calculate test targets
     calculate_targets_for_host $host
 
+    # If the tests for a product fail, make ctest output the full test output
+    # instead of just printing that some of the tests failed.
+    export CTEST_OUTPUT_ON_FAILURE=1
+
     # Run the tests for each product
     for product in "${PRODUCTS[@]}"; do
         # Check if we should perform this action.
@@ -3181,7 +3185,6 @@ for host in "${ALL_HOSTS[@]}"; do
                 )
 
                 [[ -z "${DISTCC}" ]] || EXTRA_DISTCC_OPTIONS=("DISTCC_HOSTS=localhost,lzo,cpp")
-                export CTEST_OUTPUT_ON_FAILURE=1
                 with_pushd "$(build_directory ${host} foundation)" \
                     call env "${EXTRA_DISTCC_OPTIONS[@]}" "${CMAKE}" "${cmake_options[@]}" "${EXTRA_CMAKE_OPTIONS[@]}" "${FOUNDATION_SOURCE_DIR}"
 

with_pushd "$(build_directory ${host} foundation)" \
call env "${EXTRA_DISTCC_OPTIONS[@]}" "${CMAKE}" "${cmake_options[@]}" "${EXTRA_CMAKE_OPTIONS[@]}" "${FOUNDATION_SOURCE_DIR}"

Expand Down