cmake: remove unused code

This commit is contained in:
Marc-André Moreau 2013-02-28 14:54:08 -05:00
parent 5687cd393d
commit 4fd085baaf
6 changed files with 1 additions and 162 deletions

View File

@ -329,7 +329,6 @@ endif()
# Path to put FreeRDP data
set(FREERDP_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/freerdp")
set(FREERDP_KEYMAP_PATH "${FREERDP_DATA_PATH}/keymaps")
# Path to put plugins
@ -359,9 +358,7 @@ set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}:\$ORIGIN/..")
include(CTest)
if(BUILD_TESTING)
find_package(Cmockery)
if(BUILD_TESTING)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DFREERDP_TEST_EXPORTS")
enable_testing()
@ -412,10 +409,6 @@ if(WITH_THIRD_PARTY)
add_subdirectory(third-party)
endif()
if(NOT MSVC)
add_subdirectory(keymaps)
endif()
# Packaging
SET(CPACK_BINARY_ZIP "ON")

View File

@ -1,41 +0,0 @@
# - Find Cmockery
# Find the Cmockery libraries
#
# This module defines the following variables:
# CMOCKERY_FOUND - true if CMOCKERY_INCLUDE_DIR & CMOCKERY_LIBRARY are found
# CMOCKERY_LIBRARIES - Set when CMOCKERY_LIBRARY is found
# CMOCKERY_INCLUDE_DIRS - Set when CMOCKERY_INCLUDE_DIR is found
#
#=============================================================================
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
find_path(CMOCKERY_INCLUDE_DIR NAMES cmockery.h
PATH_SUFFIXES google)
find_library(CMOCKERY_LIBRARY NAMES cmockery
DOC "The Cmockery library")
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cmockery DEFAULT_MSG CMOCKERY_LIBRARY CMOCKERY_INCLUDE_DIR)
if(CMOCKERY_FOUND)
set(CMOCKERY_LIBRARIES ${CMOCKERY_LIBRARY})
set(CMOCKERY_INCLUDE_DIRS ${CMOCKERY_INCLUDE_DIR})
endif()
mark_as_advanced(CMOCKERY_INCLUDE_DIR CMOCKERY_LIBRARY)

View File

@ -147,9 +147,4 @@ endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
if(BUILD_TESTING)
if(CMOCKERY_FOUND)
add_subdirectory(test)
endif()
endif()

View File

@ -1,2 +0,0 @@
TestCore
TestCore.c

View File

@ -1,40 +0,0 @@
set(MODULE_NAME "TestCore")
set(MODULE_PREFIX "TEST_CORE")
set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
set(${MODULE_PREFIX}_TESTS
TestCoreRts.c)
create_test_sourcelist(${MODULE_PREFIX}_SRCS
${${MODULE_PREFIX}_DRIVER}
${${MODULE_PREFIX}_TESTS})
include_directories(..)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${CMOCKERY_LIBRARIES})
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-core)
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE winpr
MODULES winpr-crt winpr-utils)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
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")

View File

@ -1,66 +0,0 @@
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <google/cmockery.h>
#include <winpr/crt.h>
#include <winpr/winpr.h>
#include <winpr/print.h>
#include <freerdp/freerdp.h>
#include "gateway/rts.h"
/* mocks */
extern void rts_generate_cookie(BYTE* cookie);
extern int rpc_in_write(rdpRpc* rpc, BYTE* data, int length);
extern int rpc_out_write(rdpRpc* rpc, BYTE* data, int length);
BYTE testCookie[16] = "\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC";
void rts_generate_cookie(BYTE* cookie)
{
CopyMemory(cookie, testCookie, 16);
}
int rpc_in_write(rdpRpc* rpc, BYTE* data, int length)
{
printf("rpc_in_write: %d\n", length);
//winpr_HexDump(data, length);
return length;
}
int rpc_out_write(rdpRpc* rpc, BYTE* data, int length)
{
printf("rpc_out_write: %d\n", length);
//winpr_HexDump(data, length);
return length;
}
/* tests */
void test_rts_generate_cookie(void **state)
{
BYTE cookie[16];
rts_generate_cookie(cookie);
assert_memory_equal(cookie, testCookie, 16);
}
void test_rpc_in_write(void **state)
{
int status;
status = rpc_in_write(NULL, NULL, 64);
assert_int_equal(status, 64);
}
int TestCoreRts(int argc, char* argv[])
{
const UnitTest tests[] =
{
unit_test(test_rts_generate_cookie),
unit_test(test_rpc_in_write),
};
return run_tests(tests);
}