Add new Libprivilege and Security-Server API tests.
[platform/core/test/security-tests.git] / tests / security-server-tests / CMakeLists.txt
1 #
2 #Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 #
16 # @file        CMakeLists.txt
17 # @author      Tomasz Swierczek (t.swierczek@samsung.com)
18 # @author      Mariusz Domanski (m.domanski@samsung.com)
19 # @brief
20 #
21
22 INCLUDE(FindPkgConfig)
23
24 # Dependencies
25 PKG_CHECK_MODULES(SEC_SRV_TESTS_DEP
26     libsmack
27     libprivilege-control
28     security-server
29     dpl-test-efl
30     dlog
31     dbus-1
32     dbus-glib-1
33     REQUIRED)
34
35 # Targets definition
36
37 SET(TARGET_SEC_SRV_CLIENT_SMACK_TESTS "security-server-tests-client-smack")
38 SET(TARGET_SEC_SRV_TC_SERVER_TESTS "security-server-tests-server")
39 SET(TARGET_SEC_SRV_PWD_TESTS "security-server-tests-password")
40 SET(TARGET_SEC_SRV_MT_TESTS "security-server-tests-mt")
41 SET(TARGET_SEC_SRV_DBUS_TESTS "security-server-tests-dbus")
42 SET(TARGET_SEC_SRV_MEASURER "security-server-tests-api-speed")
43
44
45 # Sources definition
46
47 SET(SEC_SRV_CLIENT_SMACK_SOURCES
48     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_client_smack.cpp
49     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp
50    )
51
52 SET(SEC_SRV_TC_SERVER_SOURCES
53     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_server.cpp
54     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_weird_arguments.cpp
55     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/common/security_server_tests_common.cpp
56    )
57
58 SET(SEC_SRV_PWD_SOURCES
59     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_password.cpp
60     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_clean_env.cpp
61    )
62
63 SET(SEC_SRV_MT_SOURCES
64     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_mt.cpp
65    )
66
67 SET(SEC_SRV_DBUS_SOURCES
68     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_dbus.cpp
69    )
70 SET(SEC_SRV_MEASURER_SOURCES
71     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_measurer_API_speed.cpp
72     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp
73    )
74
75 INCLUDE_DIRECTORIES(SYSTEM
76     ${SEC_SRV_TESTS_DEP_INCLUDE_DIRS}
77    )
78
79 INCLUDE_DIRECTORIES(
80     ${PROJECT_SOURCE_DIR}/tests/common/
81     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/common/
82    )
83
84 ADD_DEFINITIONS("-I/usr/include/dbus-1.0/dbus")
85
86 #LINK_DIRECTORIES(${SEC_SRV_PKGS_LIBRARY_DIRS})
87
88 ADD_EXECUTABLE(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS} ${SEC_SRV_CLIENT_SMACK_SOURCES})
89 ADD_EXECUTABLE(${TARGET_SEC_SRV_TC_SERVER_TESTS} ${SEC_SRV_TC_SERVER_SOURCES})
90 ADD_EXECUTABLE(${TARGET_SEC_SRV_PWD_TESTS} ${SEC_SRV_PWD_SOURCES})
91 ADD_EXECUTABLE(${TARGET_SEC_SRV_MT_TESTS} ${SEC_SRV_MT_SOURCES})
92 ADD_EXECUTABLE(${TARGET_SEC_SRV_DBUS_TESTS} ${SEC_SRV_DBUS_SOURCES})
93 ADD_EXECUTABLE(${TARGET_SEC_SRV_MEASURER} ${SEC_SRV_MEASURER_SOURCES})
94
95
96 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS}
97     ${SEC_SRV_TESTS_DEP_LIBRARIES}
98     tests-common)
99
100 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_TC_SERVER_TESTS}
101     ${SEC_SRV_TESTS_DEP_LIBRARIES}
102     tests-common)
103
104 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_PWD_TESTS}
105     ${SEC_SRV_TESTS_DEP_LIBRARIES}
106     tests-common)
107
108 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MT_TESTS}
109     ${SEC_SRV_TESTS_DEP_LIBRARIES}
110     tests-common)
111
112 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_DBUS_TESTS}
113     ${SEC_SRV_TESTS_DEP_LIBRARIES}
114     tests-common)
115
116 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MEASURER}
117     ${SEC_SRV_TESTS_DEP_LIBRARIES}
118     tests-common)
119
120 # Installation
121
122 INSTALL(TARGETS ${TARGET_SEC_SRV_CLIENT_SMACK_TESTS} DESTINATION /usr/bin)
123 INSTALL(TARGETS ${TARGET_SEC_SRV_TC_SERVER_TESTS} DESTINATION /usr/bin)
124 INSTALL(TARGETS ${TARGET_SEC_SRV_PWD_TESTS} DESTINATION /usr/bin)
125 INSTALL(TARGETS ${TARGET_SEC_SRV_MT_TESTS} DESTINATION /usr/bin)
126 INSTALL(TARGETS ${TARGET_SEC_SRV_DBUS_TESTS} DESTINATION /usr/bin)
127 INSTALL(TARGETS ${TARGET_SEC_SRV_MEASURER} DESTINATION /usr/bin)