Skip to content

Commit

Permalink
Error out if generate_ctest_json fails to build or run
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleFromNVIDIA committed Feb 6, 2024
1 parent c8947b3 commit 368796c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ set(test_file_content
set(CTEST_SCRIPT_DIRECTORY \".\")
set(CMAKE_INSTALL_PREFIX \"./${_RAPIDS_INSTALL_PREFIX}\")
set(CTEST_RESOURCE_SPEC_FILE \"./${rapids_test_json_file_name}\")
execute_process(COMMAND ./${rapids_test_generate_exe_name} OUTPUT_FILE \"\${CTEST_RESOURCE_SPEC_FILE}\")
execute_process(COMMAND ./${rapids_test_generate_exe_name} OUTPUT_FILE \"\${CTEST_RESOURCE_SPEC_FILE}\" COMMAND_ERROR_IS_FATAL ANY)
\n\n
")

Expand Down
12 changes: 2 additions & 10 deletions rapids-cmake/test/generate_resource_spec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,9 @@ function(rapids_test_generate_resource_spec DESTINATION filepath)

execute_process(COMMAND "${compiler}" "${eval_file}" ${compile_options} ${link_options} -o
"${eval_exe}" OUTPUT_VARIABLE compile_output
ERROR_VARIABLE compile_output)
ERROR_VARIABLE compile_output COMMAND_ERROR_IS_FATAL ANY)
endif()

if(NOT EXISTS "${eval_exe}")
message(STATUS "rapids_test_generate_resource_spec failed to build detection executable, presuming no GPUs."
)
message(STATUS "rapids_test_generate_resource_spec compile[${compiler} ${compile_options} ${link_options}] failure details are ${compile_output}"
)
file(WRITE "${filepath}" "${gpu_json_contents}")
else()
execute_process(COMMAND ${eval_exe} OUTPUT_FILE "${filepath}")
endif()
execute_process(COMMAND ${eval_exe} OUTPUT_FILE "${filepath}" COMMAND_ERROR_IS_FATAL ANY)

endfunction()

0 comments on commit 368796c

Please sign in to comment.