cmake_minimum_required(VERSION 3.10)

project(mart-common_testing)

include_directories(libs)
file(GLOB_RECURSE TEST_RCS tests_*.cpp)

message(STATUS "Found test files: ${TEST_RCS}")

add_executable(testing_mart-common
	main.cpp
	${TEST_RCS}
)

find_package(Threads REQUIRED)

target_link_libraries(testing_mart-common PRIVATE Mart::common Threads::Threads)

if(MSVC)
	string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
	target_compile_definitions(testing_mart-common PRIVATE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS)
else()
	target_compile_options(testing_mart-common PRIVATE -Wall -Wextra)
endif()


enable_testing()

# The new style below doesn't work with msvc test explorer
set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON)
include(libs/catch2/ParseAndAddCatchTests.cmake)
ParseAndAddCatchTests(testing_mart-common)



cmake_minimum_required(VERSION 3.10)

project(mart-common_testing)

include_directories(libs)
file(GLOB_RECURSE TEST_RCS tests_*.cpp)

message(STATUS "Found test files: ${TEST_RCS}")

add_executable(testing_mart-common
	main.cpp
	${TEST_RCS}
)

find_package(Threads REQUIRED)

target_link_libraries(testing_mart-common PRIVATE Mart::common Threads::Threads)

if(MSVC)
	string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
	target_compile_definitions(testing_mart-common PRIVATE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS)
else()
	target_compile_options(testing_mart-common PRIVATE -Wall -Wextra)
endif()


enable_testing()

include(libs/catch2/ParseAndAddCatchTests.cmake)

set(PARSE_CATCH_TESTS_ADD_TO_CONFIGURE_DEPENDS ON)
set(PARSE_CATCH_TESTS_ADD_TARGET_IN_TEST_NAME OFF)

ParseAndAddCatchTests(testing_mart-common)



Remove executable name from test name
[Build-Test] Remove executable name from test name
