2019-06-23 12:44:28 -07:00
|
|
|
include(CompileWarnings)
|
|
|
|
|
|
|
|
|
|
macro(wpilib_add_test name srcdir)
|
|
|
|
|
file(GLOB_RECURSE test_src ${srcdir}/*.cpp)
|
|
|
|
|
add_executable(${name}_test ${test_src})
|
2024-05-24 13:48:05 -04:00
|
|
|
set_property(TARGET ${name}_test PROPERTY FOLDER "tests")
|
2019-06-23 12:44:28 -07:00
|
|
|
wpilib_target_warnings(${name}_test)
|
2023-11-30 19:52:21 -05:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2019-06-23 12:44:28 -07:00
|
|
|
target_compile_definitions(${name}_test PRIVATE -DGTEST_LINKED_AS_SHARED_LIBRARY)
|
|
|
|
|
endif()
|
2023-11-30 19:52:21 -05:00
|
|
|
if(MSVC)
|
2021-08-20 09:02:01 -07:00
|
|
|
target_compile_options(${name}_test PRIVATE /wd4101 /wd4251)
|
2019-06-23 12:44:28 -07:00
|
|
|
endif()
|
|
|
|
|
add_test(NAME ${name} COMMAND ${name}_test)
|
|
|
|
|
endmacro()
|