@ -1,8 +1,8 @@
set ( TEST_EXE testAll )
set ( C HECK_EXE check All)
set ( G TEST_EXE testAll )
set ( C ATCH_EXE catch All)
list ( APPEND TEST_SRC
# O l d g t e s t - b a s e d t e s t s ; n e w t e s t s s h o u l d u s e C a t c h 2 , i n s t e a d .
list ( APPEND G TEST_SRC
c o n f i g / t e s t _ l l a r p _ c o n f i g _ c o n f i g . c p p
c o n f i g / t e s t _ l l a r p _ c o n f i g _ i n i . c p p
c r y p t o / t e s t _ l l a r p _ c r y p t o _ t y p e s . c p p
@ -45,39 +45,44 @@ list(APPEND TEST_SRC
u t i l / t h r e a d / t e s t _ l l a r p _ u t i l _ t h r e a d _ p o o l . c p p
)
add_executable ( ${ TEST_EXE}
add_executable ( ${ G TEST_EXE}
# h e l p e r s
m a i n . c p p
c r y p t o / m o c k _ c r y p t o . c p p
d h t / m o c k _ c o n t e x t . c p p
t e s t _ u t i l . c p p
# a c t u a l t e s t c a s e s
$ { TE S T _ S R C }
$ { G TE S T _ S R C }
)
target_link_libraries ( ${ TEST_EXE} PUBLIC gmock gtest ${ STATIC_LIB } )
target_include_directories ( ${ TEST_EXE} PRIVATE ${ CMAKE_CURRENT_SOURCE_DIR } )
target_link_libraries ( ${ G TEST_EXE} PUBLIC gmock gtest ${ STATIC_LIB } )
target_include_directories ( ${ G TEST_EXE} PRIVATE ${ CMAKE_CURRENT_SOURCE_DIR } )
if ( NOT WIN32 )
target_link_libraries ( ${ TEST_EXE} PUBLIC absl::variant )
target_link_libraries ( ${ G TEST_EXE} PUBLIC absl::variant )
else ( )
target_sources ( ${ TEST_EXE} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/win32/test.rc" )
target_link_libraries ( ${ TEST_EXE} PUBLIC ws2_32 iphlpapi shlwapi )
target_sources ( ${ G TEST_EXE} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/win32/test.rc" )
target_link_libraries ( ${ G TEST_EXE} PUBLIC ws2_32 iphlpapi shlwapi )
endif ( NOT WIN32 )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "FreeBSD" )
target_link_directories ( ${ TEST_EXE} PRIVATE /usr/local/lib )
target_link_directories ( ${ G TEST_EXE} PRIVATE /usr/local/lib )
endif ( )
add_subdirectory ( Catch2 )
add_executable ( ${ C HECK _EXE}
add_executable ( ${ C ATCH _EXE}
n o d e d b / t e s t _ n o d e d b . c p p
p a t h / t e s t _ p a t h . c p p
u t i l / t e s t _ l l a r p _ u t i l _ s t r . c p p
c h e c k _ m a i n . c p p )
target_link_libraries ( ${ CHECK_EXE } PUBLIC ${ STATIC_LIB } Catch2::Catch2 )
target_include_directories ( ${ CHECK_EXE } PRIVATE ${ CMAKE_CURRENT_SOURCE_DIR } )
target_link_libraries ( ${ CATCH_EXE } PUBLIC ${ STATIC_LIB } Catch2::Catch2 )
target_include_directories ( ${ CATCH_EXE } PRIVATE ${ CMAKE_CURRENT_SOURCE_DIR } )
# C u s t o m t a r g e t s t o i n v o k e t h e d i f f e r e n t t e s t s u i t e s :
add_custom_target ( catch COMMAND ${ CATCH_EXE } )
add_custom_target ( rungtest COMMAND ${ GTEST_EXE } )
add_custom_target ( check COMMAND ${ CHECK_EXE } )
# A d d a c u s t o m " c h e c k " t a r g e t t h a t r u n s a l l t h e t e s t s u i t e s :
add_custom_target ( check DEPENDS rungtest catch )