Skip to content

Commit

Permalink
cunit: migrate Sspi tests to CTest
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Oct 1, 2012
1 parent 440a4e2 commit a18ebef
Show file tree
Hide file tree
Showing 13 changed files with 263 additions and 262 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ install_manifest.txt
CTestTestfile.cmake
freerdp.pc
Makefile
Testing
cmake_install.cmake
CPackConfig.cmake
CPackSourceConfig.cmake
DartConfiguration.tcl

# Eclipse
*.project
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ add_definitions("-DHAVE_CONFIG_H")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/freerdp/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/freerdp/config.h)

# Unit Tests

INCLUDE(CTest)

if(BUILD_TESTING)
enable_testing()
endif()

# WinPR
set(WINPR_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/winpr/include")
include_directories(${WINPR_INCLUDE_DIR})
Expand All @@ -201,9 +209,9 @@ endif()
#find_optional_package(IPP)

# Build CUnit

find_optional_package(CUnit)
if(WITH_CUNIT)
enable_testing()
add_subdirectory(cunit)
endif()

Expand Down
3 changes: 2 additions & 1 deletion cunit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,5 @@ target_link_libraries(test_freerdp freerdp-crypto)

target_link_libraries(test_freerdp winpr-sspi)

add_test(CUnitTests ${EXECUTABLE_OUTPUT_PATH}/test_freerdp)
add_test(CUnitTests ${CMAKE_SOURCE_DIR}/cunit/test_freerdp)

10 changes: 4 additions & 6 deletions cunit/test_freerdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "test_color.h"
#include "test_bitmap.h"
#include "test_gdi.h"
#include "test_sspi.h"
#include "test_orders.h"
#include "test_ntlm.h"
#include "test_license.h"
Expand Down Expand Up @@ -120,19 +119,18 @@ const static test_suite suites[] =
//{ "cliprdr", add_cliprdr_suite },
{ "color", add_color_suite },
//{ "drdynvc", add_drdynvc_suite },
{ "gcc", add_gcc_suite },
//{ "gcc", add_gcc_suite },
{ "gdi", add_gdi_suite },
{ "license", add_license_suite },
{ "mcs", add_mcs_suite },
//{ "mcs", add_mcs_suite },
{ "mppc", add_mppc_suite },
{ "mppc_enc", add_mppc_enc_suite },
{ "ntlm", add_ntlm_suite },
{ "orders", add_orders_suite },
//{ "orders", add_orders_suite },
{ "pcap", add_pcap_suite },
//{ "rail", add_rail_suite },
{ "rfx", add_rfx_suite },
{ "nsc", add_nsc_suite },
{ "sspi", add_sspi_suite }
{ "nsc", add_nsc_suite }
};
#define N_SUITES (sizeof suites / sizeof suites[0])

Expand Down
225 changes: 0 additions & 225 deletions cunit/test_sspi.c

This file was deleted.

29 changes: 0 additions & 29 deletions cunit/test_sspi.h

This file was deleted.

5 changes: 5 additions & 0 deletions winpr/libwinpr/sspi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ else()
target_link_libraries(winpr-sspi ${WINPR_SSPI_LIBS})
install(TARGETS winpr-sspi DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

if(BUILD_TESTING)
add_subdirectory(test)
endif()

3 changes: 3 additions & 0 deletions winpr/libwinpr/sspi/test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TestSspi
TestSspi.c

25 changes: 25 additions & 0 deletions winpr/libwinpr/sspi/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

set(MODULE_NAME "TestSspi")
set(MODULE_PREFIX "TEST_SSPI")

set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)

set(${MODULE_PREFIX}_TESTS
TestQuerySecurityPackageInfo.c
TestEnumerateSecurityPackages.c
TestInitializeSecurityContext.c
TestAcquireCredentialsHandle.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-sspi)

foreach(test ${${MODULE_PREFIX}_TESTS})
get_filename_component(TestName ${test} NAME_WE)
add_test(${TestName} ${EXECUTABLE_OUTPUT_PATH}/${MODULE_NAME} ${TestName})
endforeach()

Loading

0 comments on commit a18ebef

Please sign in to comment.