|
@@ -15,36 +15,38 @@ POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
|
|
|
file(GLOB_RECURSE HDRS_G "src/*.h" )
|
|
file(GLOB_RECURSE HDRS_G "src/*.h" )
|
|
|
POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
|
|
POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
|
|
|
|
|
|
|
|
-POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
|
|
|
|
|
|
|
+# WinDriver depends on WinTestRunner which depends on MFC, and we don't want that
|
|
|
|
|
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
|
|
src/WinDriver.cpp
|
|
src/WinDriver.cpp
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-POCO_SOURCES_PLAT( TEST_SRCS FoundationTest WINCE
|
|
|
|
|
|
|
+POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
|
|
src/WinCEDriver.cpp
|
|
src/WinCEDriver.cpp
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
|
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
|
|
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
|
|
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TESTUNIT} -all)
|
|
|
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory
|
|
set_tests_properties(${LIBNAME} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=.") # The SharedLibaryTest has to look for shared libraries in the working directory
|
|
|
-#set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
|
|
|
|
|
|
+
|
|
|
target_link_libraries( ${TESTUNIT} PocoFoundation CppUnit )
|
|
target_link_libraries( ${TESTUNIT} PocoFoundation CppUnit )
|
|
|
-if( WIN32)
|
|
|
|
|
- add_definitions("-D_AFXDLL")
|
|
|
|
|
- target_link_libraries( ${TESTUNIT} WinTestRunner)
|
|
|
|
|
-else()
|
|
|
|
|
|
|
+if(UNIX)
|
|
|
target_link_libraries( ${TESTUNIT} pthread)
|
|
target_link_libraries( ${TESTUNIT} pthread)
|
|
|
-endif(WIN32)
|
|
|
|
|
|
|
+endif(UNIX)
|
|
|
|
|
|
|
|
# The test is run in the runtime directory. So the test data is copied there too
|
|
# The test is run in the runtime directory. So the test data is copied there too
|
|
|
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
|
add_custom_command(TARGET ${TESTUNIT} POST_BUILD
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data )
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/data )
|
|
|
|
|
|
|
|
# TestApp
|
|
# TestApp
|
|
|
|
|
+if(WINCE)
|
|
|
|
|
+add_executable( TestApp src/TestApp_WINCE.cpp )
|
|
|
|
|
+set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup")
|
|
|
|
|
+else()
|
|
|
add_executable( TestApp src/TestApp.cpp )
|
|
add_executable( TestApp src/TestApp.cpp )
|
|
|
|
|
+endif()
|
|
|
# The test is run in the runtime directory. So the TestApp is built there too because it is used by the tests
|
|
# The test is run in the runtime directory. So the TestApp is built there too because it is used by the tests
|
|
|
set_target_properties( TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
|
set_target_properties( TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
|
|
|
target_link_libraries( TestApp PocoFoundation )
|
|
target_link_libraries( TestApp PocoFoundation )
|
|
|
-# TODO: Add TestApp_WINCE
|
|
|
|
|
|
|
|
|
|
if(NOT POCO_STATIC)
|
|
if(NOT POCO_STATIC)
|
|
|
# TestLibrary
|
|
# TestLibrary
|