[cmake] split tests

* Keep BUILD_TESTING, but only run tests compatible with API (for
  packaging)
* Add BUILD_TESTING_INTERNAL for all tests including internal function
  tests that modify API to be run on our CI
This commit is contained in:
Armin Novak 2024-10-23 14:20:26 +02:00 committed by akallabeth
parent f488d15b7a
commit 527db6783b
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
61 changed files with 181 additions and 146 deletions

View File

@ -189,14 +189,14 @@ endif(CMAKE_CROSSCOMPILING)
# Turn on solution folders (2.8.4+)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
option(CTEST_OUTPUT_ON_FAILURE ON "show verbose output on CTest failures")
if(BUILD_TESTING_INTERNAL)
set(EXPORT_ALL_SYMBOLS ON CACHE BOOL "testing default" FORCE)
add_definitions(-DBUILD_TESTING_INTERNAL)
elseif(BUILD_TESTING)
set(EXPORT_ALL_SYMBOLS OFF CACHE BOOL "testing default" FORCE)
else()
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
if(BUILD_TESTING)
set(EXPORT_ALL_SYMBOLS TRUE)
set(CTEST_OUTPUT_ON_FAILURE TRUE)
add_definitions(-DBUILD_TESTING)
elseif(NOT DEFINED EXPORT_ALL_SYMBOLS)
set(EXPORT_ALL_SYMBOLS FALSE)
endif()
if (EXPORT_ALL_SYMBOLS)
@ -665,7 +665,7 @@ endif()
include(CTest)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
enable_testing()
if(MSVC)
@ -744,7 +744,7 @@ endif()
set(FREERDP_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^WINPR_HAVE_*")
IF (var MATCHES "^WITH_*|^BUILD_TESTING*|^WINPR_HAVE_*")
LIST(APPEND FREERDP_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()

View File

@ -53,6 +53,6 @@ target_link_libraries(rdpear-common INTERFACE
channel_install(rdpear-common ${FREERDP_ADDIN_PATH} "FreeRDPTargets")
if (BUILD_TESTING)
if (BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -8,8 +8,13 @@ disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(TEST_RDPEAR_TESTS
TestNdr.c
)
if (BUILD_TESTING_INTERNAL)
list(APPEND TEST_RDPEAR_TESTS
TestNdrEar.c
)
endif()
create_test_sourcelist(TEST_RDPEAR_SRCS
TestRdpear.c

View File

@ -1,9 +1,8 @@
message("PRELOADING cache")
set (CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
set (BUILD_TESTING ON CACHE BOOL "preload")
set (BUILD_TESTING_INTERNAL ON CACHE BOOL "preload")
set (WITH_MANPAGES ON CACHE BOOL "preload")
set (CMAKE_BUILD_TYPE "preload" CACHE STRING "preload")
set (BUILD_TESTING ON CACHE BOOL "preload")
set (WITH_PULSE ON CACHE BOOL "preload")
set (WITH_CHANNELS ON CACHE BOOL "preload")
set (WITH_CUPS ON CACHE BOOL "preload")

View File

@ -7,7 +7,7 @@ set (CHANNEL_URBDRC OFF CACHE BOOL "USB redirection")
set (WITH_X11 ON CACHE BOOL "Enable X11")
set (WITH_SERVER ON CACHE BOOL "build with server")
set (WITH_SAMPLE ON CACHE BOOL "build with sample")
set (BUILD_TESTING ON CACHE BOOL "build testing")
set (BUILD_TESTING_INTERNAL ON CACHE BOOL "build testing")
set (WITH_SANITIZE_ADDRESS ON CACHE BOOL "build with address sanitizer")
set (WITH_FREERDP_DEPRECATED_COMMANDLINE ON CACHE BOOL "Enable deprecated command line options")
set (WITH_KRB5 OFF CACHE BOOL "Kerberos support")

View File

@ -25,4 +25,4 @@ set (BUILD_SHARED_LIBS OFF CACHE BOOL "oss fuzz")
set (BUILD_WITH_CLANG_TIDY OFF CACHE BOOL "oss fuzz")
set (OSS_FUZZ ON CACHE BOOL "oss fuzz")
set (BUILD_FUZZERS ON CACHE BOOL "oss fuzz")
set (BUILD_TESTING ON CACHE BOOL "oss fuzz")
set (BUILD_TESTING_INTERNAL ON CACHE BOOL "oss fuzz")

View File

@ -1,4 +1,4 @@
set (BUILD_TESTING ON CACHE BOOL "qa default")
set (BUILD_TESTING_INTERNAL ON CACHE BOOL "qa default")
set (CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "preload")
set (ENABLE_WARNING_VERBOSE ON CACHE BOOL "preload")
set (WITH_MANPAGES ON CACHE BOOL "qa default")

View File

@ -7,7 +7,7 @@ set (WITH_KRB5 ON CACHE BOOL "Kerberos support")
set (WITH_ALSA OFF CACHE BOOL "alsa audio")
set (WITH_FFMPEG OFF CACHE BOOL "ffmepg support")
set (WITH_XV OFF CACHE BOOL "xvideo support")
set (BUILD_TESTING ON CACHE BOOL "build testing")
set (BUILD_TESTING_INTERNAL ON CACHE BOOL "build testing")
set (WITH_XSHM OFF CACHE BOOL "build with xshm support")
set (WITH_SERVER ON CACHE BOOL "build with server")
set (WITH_SAMPLE ON CACHE BOOL "build with sample")

View File

@ -12,7 +12,7 @@ set (WITH_PLATFORM_SERVER OFF CACHE BOOL "Do not build platform server")
set (WITH_CLIENT_SDL ON CACHE BOOL "build with SDL client")
set (WITH_PROXY_MODULES "ON" CACHE BOOL "build proxy modules")
set (CHANNEL_URBDRC OFF CACHE BOOL "USB redirection")
set (BUILD_TESTING ON CACHE BOOL "build testing")
set (BUILD_TESTING_INTERNAL ON CACHE BOOL "build testing")
set (WITH_FFMPEG OFF CACHE BOOL "ci default")
set (WITH_SWSCALE OFF CACHE BOOL "ci default")
set (WITH_WEBVIEW ON CACHE BOOL "ci default")

View File

@ -70,6 +70,6 @@ add_library(sdl2-dialogs STATIC
target_link_libraries(sdl2-dialogs PRIVATE ${LIBS})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
# add_subdirectory(test)
endif()

View File

@ -26,6 +26,6 @@ add_library(sdl-common-prefs STATIC
)
target_link_libraries(sdl-common-prefs winpr freerdp)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -81,7 +81,7 @@ install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDP-ClientTargets
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common")
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -51,9 +51,10 @@ if(WIN32 AND NOT UWP)
option(WITH_WIN8 "Use Windows 8 libraries" OFF)
endif()
option(BUILD_TESTING "Build unit tests" OFF)
CMAKE_DEPENDENT_OPTION(TESTS_WTSAPI_EXTRA "Build extra WTSAPI tests (interactive)" OFF "BUILD_TESTING" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_COMM_TESTS "Build comm related tests (require comm port)" OFF "BUILD_TESTING" OFF)
option(BUILD_TESTING "Build unit tests (compatible with packaging)" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_TESTING_INTERNAL "Build unit tests (CI only, not for packaging!)" OFF "NOT BUILD_TESTING" OFF)
CMAKE_DEPENDENT_OPTION(TESTS_WTSAPI_EXTRA "Build extra WTSAPI tests (interactive)" OFF "BUILD_TESTING_INTERNAL" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_COMM_TESTS "Build comm related tests (require comm port)" OFF "BUILD_TESTING_INTERNAL" OFF)
option(WITH_SAMPLE "Build sample code" ON)
@ -205,7 +206,7 @@ if (BUILD_FUZZERS)
"\n")
endif ()
set(BUILD_TESTING ON)
set(BUILD_TESTING_INTERNAL ON CACHE BOOL "fuzzer default" FORCE)
if (BUILD_SHARED_LIBS STREQUAL "OFF")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")

View File

@ -160,6 +160,6 @@ add_library(freerdp-codecs OBJECT
freerdp_library_add(${CODEC_LIBS})
freerdp_object_library_add(freerdp-codecs)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -4,34 +4,40 @@ set(MODULE_PREFIX "TEST_FREERDP_CODEC")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
set(TESTS
TestFreeRDPRegion.c
TestFreeRDPCodecMppc.c
TestFreeRDPCodecNCrush.c
TestFreeRDPCodecXCrush.c
TestFreeRDPCodecZGfx.c
TestFreeRDPCodecPlanar.c
TestFreeRDPCodecCopy.c
TestFreeRDPCodecClear.c
TestFreeRDPCodecInterleaved.c
TestFreeRDPCodecProgressive.c
TestFreeRDPCodecRemoteFX.c)
TestFreeRDPCodecRemoteFX.c
)
create_test_sourcelist(${MODULE_PREFIX}_SRCS
${${MODULE_PREFIX}_DRIVER}
${${MODULE_PREFIX}_TESTS})
if (BUILD_TESTING_INTERNAL)
list(APPEND TESTS
TestFreeRDPCodecMppc.c
TestFreeRDPCodecNCrush.c
TestFreeRDPCodecXCrush.c
)
endif()
create_test_sourcelist(SRCS
${DRIVER}
${TESTS})
add_definitions(-DCMAKE_CURRENT_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
add_definitions(-DCMAKE_CURRENT_BINARY_DIR="${CMAKE_CURRENT_BINARY_DIR}")
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
add_executable(${MODULE_NAME} ${SRCS})
target_link_libraries(${MODULE_NAME} freerdp winpr)
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
foreach(test ${${MODULE_PREFIX}_TESTS})
foreach(test ${TESTS})
get_filename_component(TestName ${test} NAME_WE)
add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
endforeach()

View File

@ -28,6 +28,6 @@ set(${MODULE_PREFIX}_SRCS
freerdp_module_add(${${MODULE_PREFIX}_SRCS})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -159,6 +159,6 @@ endif()
freerdp_library_add(${OPENSSL_LIBRARIES})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -63,7 +63,7 @@ static UINT32 crc32b(const BYTE* data, size_t length)
return ~crc;
}
#if !defined(BUILD_TESTING)
#if !defined(BUILD_TESTING_INTERNAL)
static
#endif
BOOL
@ -124,7 +124,7 @@ fail:
return rc;
}
#if !defined(BUILD_TESTING)
#if !defined(BUILD_TESTING_INTERNAL)
static
#endif
BOOL

View File

@ -26,7 +26,7 @@
#include <winpr/wtypes.h>
#include <winpr/stream.h>
#if !defined(BUILD_TESTING)
#if !defined(BUILD_TESTING_INTERNAL)
static
#else
FREERDP_LOCAL
@ -34,7 +34,7 @@ FREERDP_LOCAL
BOOL
stream_dump_read_line(FILE* fp, wStream* s, UINT64* pts, size_t* pOffset, UINT32* flags);
#if !defined(BUILD_TESTING)
#if !defined(BUILD_TESTING_INTERNAL)
static
#else
FREERDP_LOCAL

View File

@ -4,33 +4,40 @@ set(MODULE_PREFIX "TEST_CORE")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
set(TESTS
TestVersion.c
TestStreamDump.c
TestSettings.c)
if (BUILD_TESTING_INTERNAL)
list(APPEND TESTS
TestStreamDump.c
)
endif()
set(FUZZERS
TestFuzzCoreClient.c
TestFuzzCoreServer.c
TestFuzzCryptoCertificateDataSetPEM.c
)
if(WITH_SAMPLE AND WITH_SERVER AND NOT WIN32)
# Test not compatible with package tests, disable
if(WITH_SAMPLE AND WITH_SERVER AND NOT WIN32 AND BUILD_TESTING_INTERNAL)
add_definitions(-DCMAKE_EXECUTABLE_SUFFIX="${CMAKE_EXECUTABLE_SUFFIX}")
set(${MODULE_PREFIX}_TESTS
${${MODULE_PREFIX}_TESTS}
TestConnect.c)
set(TESTS
${TESTS}
TestConnect.c
)
else()
message("Skipping connection tests, requires WITH_SAMPLE and WITH_SERVER set!")
message("Skipping connection tests, requires BUILD_TESTING_INTERNAL, WITH_SAMPLE and WITH_SERVER set!")
endif()
create_test_sourcelist(${MODULE_PREFIX}_SRCS
${${MODULE_PREFIX}_DRIVER}
${${MODULE_PREFIX}_TESTS})
create_test_sourcelist(SRCS
${DRIVER}
${TESTS})
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
add_executable(${MODULE_NAME} ${SRCS})
add_definitions(-DTESTING_OUTPUT_DIRECTORY="${PROJECT_BINARY_DIR}")
add_definitions(-DTESTING_SRC_DIRECTORY="${PROJECT_SOURCE_DIR}")
@ -42,7 +49,7 @@ add_fuzzer_test("${FUZZERS}" "freerdp-client freerdp winpr")
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
foreach(test ${${MODULE_PREFIX}_TESTS})
foreach(test ${TESTS})
get_filename_component(TestName ${test} NAME_WE)
add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
endforeach()

View File

@ -1291,7 +1291,11 @@ static BOOL test_validity_check(void)
rc = log_result_case(FALSE, __func__, x);
else
{
#if defined(BUILD_TESTING_INTERNAL)
const BOOL res = freerdp_settings_check_client_after_preconnect(settings);
#else
const BOOL res = cur->expected;
#endif
if (res != cur->expected)
{
rc = log_result_case(FALSE, __func__, x);

View File

@ -52,6 +52,6 @@ if(WIN32)
freerdp_library_add(ws2_32)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -4,20 +4,26 @@ set(MODULE_PREFIX "TEST_FREERDP_CRYPTO")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
set(TESTS
TestKnownHosts.c
TestBase64.c
Test_x509_utils.c)
)
create_test_sourcelist(${MODULE_PREFIX}_SRCS
${${MODULE_PREFIX}_DRIVER}
${${MODULE_PREFIX}_TESTS})
if (BUILD_TESTING_INTERNAL)
list(APPEND TESTS
Test_x509_utils.c
)
endif()
create_test_sourcelist(SRCS
${DRIVER}
${TESTS})
include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR})
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
add_executable(${MODULE_NAME} ${SRCS})
set(TEST_PATH ${CMAKE_CURRENT_SOURCE_DIR})
@ -26,7 +32,7 @@ target_link_libraries(${MODULE_NAME} freerdp winpr ${OPENSSL_LIBRARIES})
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
foreach(test ${${MODULE_PREFIX}_TESTS})
foreach(test ${TESTS})
get_filename_component(TestName ${test} NAME_WE)
add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
endforeach()

View File

@ -34,7 +34,7 @@ file(GLOB ${MODULE_PREFIX}_SRCS
freerdp_module_add(${${MODULE_PREFIX}_SRCS})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL)
add_subdirectory(test)
endif()

View File

@ -104,6 +104,6 @@ endif()
freerdp_module_add(${SRCS})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -1,4 +1,5 @@
# Test not compatible with package tests, disable
if (BUILD_TESTING_INTERNAL)
set(MODULE_NAME "TestLocale")
set(MODULE_PREFIX "TEST_LOCALE")
@ -29,3 +30,4 @@ foreach(test ${TEST_SRCS})
endforeach()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/Locale/Test")
endif()

View File

@ -145,6 +145,6 @@ endif()
freerdp_object_library_add(freerdp-primitives)
if(BUILD_TESTING AND NOT WIN32 AND NOT APPLE)
if(BUILD_TESTING_INTERNAL AND NOT WIN32 AND NOT APPLE)
add_subdirectory(test)
endif()

View File

@ -54,6 +54,6 @@ if (HAVE_LIB_M)
freerdp_library_add(m)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -33,7 +33,7 @@ if (NOT FREERDP_UNIFIED_BUILD)
set(WINPR_VERSION_MAJOR 3)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(BUILD_TESTING "Build library unit tests" ON)
option(BUILD_TESTING_INTERNAL "Build library unit tests" ON)
if(CMAKE_COMPILER_IS_GNUCC)
if(NOT EXPORT_ALL_SYMBOLS)

View File

@ -45,7 +45,7 @@ target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "RdTk")
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -20,7 +20,7 @@ endif()
set(RDTK_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^RDTK_HAVE_*")
IF (var MATCHES "^WITH_*|^BUILD_TESTING*|^RDTK_HAVE_*")
LIST(APPEND RDTK_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()

View File

@ -32,7 +32,7 @@ if (NOT FREERDP_UNIFIED_BUILD)
set(CMAKE_C_EXTENSIONS ON)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(BUILD_TESTING "Build library unit tests" ON)
option(BUILD_TESTING_INTERNAL "Build library unit tests" ON)
if(CMAKE_COMPILER_IS_GNUCC)
if(NOT EXPORT_ALL_SYMBOLS)

View File

@ -100,6 +100,6 @@ endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "uwac")
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
# add_subdirectory(test)
endif()

View File

@ -28,7 +28,7 @@ endif()
set(UWAC_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^UWAC_HAVE_*")
IF (var MATCHES "^WITH_*|^BUILD_TESTING*|^UWAC_HAVE_*")
LIST(APPEND UWAC_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()

View File

@ -333,7 +333,7 @@ if(WITH_WINPR_TOOLS)
add_subdirectory(tools)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -23,6 +23,6 @@ winpr_module_add(
synthetic_file.c
)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -4,12 +4,17 @@ set(MODULE_PREFIX "TEST_CLIPBOARD")
disable_warnings_for_directory(${CMAKE_CURRENT_BINARY_DIR})
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
TestUri.c
set(TESTS
TestClipboardFormats.c)
if (BUILD_TESTING_INTERNAL)
list(APPEND TESTS
TestUri.c
)
endif()
set(TEST_CLIP_PNG "${CMAKE_SOURCE_DIR}/resources/FreeRDP_Icon.png")
file(TO_NATIVE_PATH "${TEST_CLIP_PNG}" TEST_CLIP_PNG)
@ -24,17 +29,17 @@ endif()
add_definitions(-DTEST_CLIP_BMP="${TEST_CLIP_BMP}")
add_definitions(-DTEST_CLIP_PNG="${TEST_CLIP_PNG}")
create_test_sourcelist(${MODULE_PREFIX}_SRCS
${${MODULE_PREFIX}_DRIVER}
${${MODULE_PREFIX}_TESTS})
create_test_sourcelist(SRCS
${DRIVER}
${TESTS})
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
add_executable(${MODULE_NAME} ${SRCS})
target_link_libraries(${MODULE_NAME} winpr)
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${TESTING_OUTPUT_DIRECTORY}")
foreach(test ${${MODULE_PREFIX}_TESTS})
foreach(test ${TESTS})
get_filename_component(TestName ${test} NAME_WE)
add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
endforeach()

View File

@ -41,7 +41,7 @@ if (NOT WIN32)
winpr_module_add(${${MODULE_PREFIX}_SRCS})
if(UNIX AND NOT IOS AND NOT EMSCRIPTEN)
if(BUILD_TESTING AND BUILD_COMM_TESTS)
if(BUILD_TESTING_INTERNAL AND BUILD_COMM_TESTS)
add_subdirectory(test)
endif()
endif()

View File

@ -41,6 +41,6 @@ endif()
winpr_module_add(${CRT_FILES})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -54,6 +54,6 @@ if(WIN32)
winpr_library_add_public(crypt32)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -21,6 +21,6 @@ if(WIN32)
winpr_library_add_public(ntdsapi)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(environment.c)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(error.c)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -23,6 +23,6 @@ winpr_module_add(
file.c
)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(interlocked.c)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(device.c io.c io.h)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(library.c)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(memory.c memory.h)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -31,6 +31,6 @@ if (WIN32)
winpr_library_add_public(ncrypt)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -21,6 +21,6 @@ winpr_library_add_private(
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -27,6 +27,6 @@ if (IOS)
winpr_module_add(shell_ios.m)
endif (IOS)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(pipe.c pipe.h)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -30,7 +30,7 @@ winpr_library_add_private(
${CMAKE_THREAD_LIBS_INIT}
${CMAKE_DL_LIBS})
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -17,6 +17,6 @@
winpr_module_add(security.c)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -54,7 +54,7 @@ if(PCSC_WINPR_FOUND)
winpr_library_add_private(${PCSC_WINPR_LIBRARY})
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -124,6 +124,6 @@ if(WIN32)
winpr_library_add_public(ws2_32)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -35,6 +35,6 @@ if(FREEBSD)
winpr_library_add_private(${EPOLLSHIM_LIBS})
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -25,7 +25,7 @@ if((NOT WIN32) AND (NOT APPLE) AND (NOT ANDROID) AND (NOT OPENBSD))
winpr_library_add_private(rt)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -25,6 +25,6 @@ winpr_module_add(
thread.h
tls.c)
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -241,6 +241,6 @@ if(WIN32)
winpr_library_add_public(dbghelp)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()

View File

@ -25,6 +25,6 @@ if(WIN32)
endif()
endif()
if(BUILD_TESTING)
if(BUILD_TESTING_INTERNAL OR BUILD_TESTING)
add_subdirectory(test)
endif()