d2ab631c40
* Fixed TestUri unit test * Make proper unit test out of the test function * Add proper test cases * Replace FindFirstFileA with FindFirstFileW for addins This allows addin paths to contain unicode symbols. * Fixed parse_uri_to_local_file definition * Move to common clipboard.c file * Move to header file so it can be included in test case * Added WINPR_LOCAL for test builds This macro exports internal functions in case of a unit test build This way unit tests can access these without other workarounds. * Fixed typo in function name is_dos_driver * Cleaned up FindFirstFileW call Use a wrapper function to convert to unicode and call the function * Cleaned up BUILD_TESTING and EXPORT_ALL_SYMBOLS * EXPORT_ALL_SYMBOLS now does as the name implies and exports all non static functions/variables from the library. * BUILD_TESTING now only sets the defines for test code and activates EXPORT_ALL_SYMBOLS to allow tests to access internal code * Fixed windows client warnings * disable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
28 lines
759 B
CMake
28 lines
759 B
CMake
|
|
set(MODULE_NAME "TestClipboard")
|
|
set(MODULE_PREFIX "TEST_CLIPBOARD")
|
|
|
|
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
|
|
|
|
set(${MODULE_PREFIX}_TESTS
|
|
TestUri.c
|
|
TestClipboardFormats.c)
|
|
|
|
create_test_sourcelist(${MODULE_PREFIX}_SRCS
|
|
${${MODULE_PREFIX}_DRIVER}
|
|
${${MODULE_PREFIX}_TESTS})
|
|
|
|
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
|
target_link_libraries(${MODULE_NAME} winpr)
|
|
|
|
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
"${TESTING_OUTPUT_DIRECTORY}")
|
|
|
|
foreach(test ${${MODULE_PREFIX}_TESTS})
|
|
get_filename_component(TestName ${test} NAME_WE)
|
|
add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
|
|
endforeach()
|
|
|
|
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test")
|
|
|