Skip to content

Commit

Permalink
Fix errors in test when cmake is in a file path with spaces
Browse files Browse the repository at this point in the history
Happens on Windows Github action runners.
  • Loading branch information
joto committed Oct 29, 2024
1 parent f1bcbf7 commit 1024cc9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmake/run_test_compare_output.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ if(cmd2)
endif()
endif()

set(compare "${CMAKE_COMMAND} -E compare_files ${reference} ${output}")
set(compare "${CMAKE_COMMAND};-E;compare_files;${reference};${output}")
message("Executing: ${compare}")
separate_arguments(compare)
execute_process(
COMMAND ${compare}
RESULT_VARIABLE result
)

if(result)
message(SEND_ERROR "Test output does not match '${reference}'. Output is in '${output}'.")
if(result AND NOT result EQUAL 0)
message(SEND_ERROR "Test output does not match '${reference}'. Output is in '${output}'. Result: ${result}.")
endif()

0 comments on commit 1024cc9

Please sign in to comment.