Skip to content

Commit

Permalink
trying diff again
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Sep 20, 2024
1 parent dec7af0 commit 6630fcc
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# # Define a test that uses the path to the executable
# if(WIN32)
# add_test(NAME CompareOutput
# COMMAND ${CMAKE_COMMAND} -E env cmd /c "$<TARGET_FILE:cloudj_standalone> > actual_output.txt && ${CMAKE_COMMAND} -E compare_files actual_output.txt ${CMAKE_SOURCE_DIR}/test/expected_output/reference_output.txt"
# WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bin
# )
# else()
# add_test(NAME CompareOutput
# COMMAND ${CMAKE_COMMAND} -E env sh -c "$<TARGET_FILE:cloudj_standalone> > actual_output.txt && ${CMAKE_COMMAND} -E compare_files actual_output.txt ${CMAKE_SOURCE_DIR}/test/expected_output/reference_output.txt"
# WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bin
# )
# endif()

# Define a test that uses the path to the executable
if(WIN32)
add_test(NAME CompareOutput
COMMAND ${CMAKE_COMMAND} -E env cmd /c "$<TARGET_FILE:cloudj_standalone> > actual_output.txt && ${CMAKE_COMMAND} -E compare_files actual_output.txt ${CMAKE_SOURCE_DIR}/test/expected_output/reference_output.txt"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bin
)
else()
add_test(NAME CompareOutput
COMMAND ${CMAKE_COMMAND} -E env sh -c "$<TARGET_FILE:cloudj_standalone> > actual_output.txt && ${CMAKE_COMMAND} -E compare_files actual_output.txt ${CMAKE_SOURCE_DIR}/test/expected_output/reference_output.txt"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bin
)
endif()
add_test(NAME CompareOutput
COMMAND ${CMAKE_COMMAND} -E env sh -c "$<TARGET_FILE:cloudj_standalone> > actual_output.txt && diff actual_output.txt ${CMAKE_SOURCE_DIR}/test/expected_output/reference_output.txt"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/bin
)

0 comments on commit 6630fcc

Please sign in to comment.