Convert path to test inputs folder to native syntax on windows to make tests with file copying portable.
This commit is contained in:
@ -36,7 +36,11 @@ if(Python_EXECUTABLE)
|
||||
COMMENT "Check completeness of force style tests")
|
||||
endif()
|
||||
|
||||
set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
string(REPLACE "/" "\\\\" TEST_INPUT_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
||||
else()
|
||||
set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||
endif()
|
||||
add_library(style_tests STATIC yaml_writer.cpp error_stats.cpp test_config_reader.cpp test_main.cpp)
|
||||
if(YAML_FOUND)
|
||||
target_compile_definitions(style_tests PRIVATE TEST_INPUT_FOLDER=${TEST_INPUT_FOLDER})
|
||||
|
||||
Reference in New Issue
Block a user