b22e3cac26a8324ff548c1c159ee232091af87a2
[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_COMMON "security-server-tests-common")
38 SET(TARGET_SEC_SRV_CLIENT_SMACK_TESTS "security-server-tests-client-smack")
39 SET(TARGET_SEC_SRV_TC_SERVER_TESTS "security-server-tests-server")
40 SET(TARGET_SEC_SRV_PWD_TESTS "security-server-tests-password")
41 SET(TARGET_SEC_SRV_PRIVILEGE_TESTS "security-server-tests-privilege")
42 SET(TARGET_SEC_SRV_STRESS_TESTS "security-server-tests-stress")
43 SET(TARGET_SEC_SRV_MT_TESTS "security-server-tests-mt")
44 SET(TARGET_SEC_SRV_DBUS_TESTS "security-server-tests-dbus")
45 SET(TARGET_SEC_SRV_MEASURER "security-server-tests-api-speed")
46
47
48 # Sources definition
49
50 SET(SEC_SRV_COMMON_SOURCES
51     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/common/security_server_tests_common.cpp
52    )
53
54 SET(SEC_SRV_CLIENT_SMACK_SOURCES
55     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_client_smack.cpp
56     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp
57    )
58
59 SET(SEC_SRV_TC_SERVER_SOURCES
60     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/server.cpp
61     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/cookie_api.cpp
62     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/weird_arguments.cpp
63     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_clean_env.cpp
64    )
65
66 SET(SEC_SRV_PWD_SOURCES
67     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_password.cpp
68     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_clean_env.cpp
69    )
70
71 SET(SEC_SRV_PRIVILEGE_SOURCES
72     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_privilege.cpp
73     ${PROJECT_SOURCE_DIR}/tests/libprivilege-control-tests/libprivilege-control_test_common.cpp
74    )
75
76 SET(SEC_SRV_STRESS_SOURCES
77     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_stress.cpp
78    )
79
80 SET(SEC_SRV_MT_SOURCES
81     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_mt.cpp
82    )
83
84 SET(SEC_SRV_DBUS_SOURCES
85     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_dbus.cpp
86    )
87
88 SET(SEC_SRV_MEASURER_SOURCES
89     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_measurer_API_speed.cpp
90     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp
91    )
92
93 INCLUDE_DIRECTORIES(SYSTEM
94     ${SEC_SRV_TESTS_DEP_INCLUDE_DIRS}
95    )
96
97 INCLUDE_DIRECTORIES(
98     ${PROJECT_SOURCE_DIR}/tests/common/
99     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/common/
100     ${PROJECT_SOURCE_DIR}/tests/libprivilege-control-tests/common/
101    )
102
103 ADD_DEFINITIONS("-I/usr/include/dbus-1.0/dbus")
104
105 #LINK_DIRECTORIES(${SEC_SRV_PKGS_LIBRARY_DIRS})
106
107 ADD_LIBRARY(${TARGET_SEC_SRV_COMMON} STATIC ${SEC_SRV_COMMON_SOURCES})
108 ADD_EXECUTABLE(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS} ${SEC_SRV_CLIENT_SMACK_SOURCES})
109 ADD_EXECUTABLE(${TARGET_SEC_SRV_TC_SERVER_TESTS} ${SEC_SRV_TC_SERVER_SOURCES})
110 ADD_EXECUTABLE(${TARGET_SEC_SRV_PWD_TESTS} ${SEC_SRV_PWD_SOURCES})
111 ADD_EXECUTABLE(${TARGET_SEC_SRV_PRIVILEGE_TESTS} ${SEC_SRV_PRIVILEGE_SOURCES})
112 ADD_EXECUTABLE(${TARGET_SEC_SRV_STRESS_TESTS} ${SEC_SRV_STRESS_SOURCES})
113 ADD_EXECUTABLE(${TARGET_SEC_SRV_MT_TESTS} ${SEC_SRV_MT_SOURCES})
114 ADD_EXECUTABLE(${TARGET_SEC_SRV_DBUS_TESTS} ${SEC_SRV_DBUS_SOURCES})
115 ADD_EXECUTABLE(${TARGET_SEC_SRV_MEASURER} ${SEC_SRV_MEASURER_SOURCES})
116
117
118 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS}
119     ${SEC_SRV_TESTS_DEP_LIBRARIES}
120     tests-common)
121
122 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_TC_SERVER_TESTS}
123     ${TARGET_SEC_SRV_COMMON}
124     ${SEC_SRV_TESTS_DEP_LIBRARIES}
125     tests-common)
126
127 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_PWD_TESTS}
128     ${TARGET_SEC_SRV_COMMON}
129     ${SEC_SRV_TESTS_DEP_LIBRARIES}
130     tests-common)
131
132 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_PRIVILEGE_TESTS}
133     ${SEC_SRV_TESTS_DEP_LIBRARIES}
134     tests-common)
135
136 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_STRESS_TESTS}
137     ${SEC_SRV_TESTS_DEP_LIBRARIES}
138     tests-common)
139
140 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MT_TESTS}
141     ${SEC_SRV_TESTS_DEP_LIBRARIES}
142     tests-common)
143
144 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_DBUS_TESTS}
145     ${SEC_SRV_TESTS_DEP_LIBRARIES}
146     tests-common)
147
148 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MEASURER}
149     ${TARGET_SEC_SRV_COMMON}
150     ${SEC_SRV_TESTS_DEP_LIBRARIES}
151     tests-common)
152
153 # Installation
154
155 INSTALL(TARGETS ${TARGET_SEC_SRV_CLIENT_SMACK_TESTS} DESTINATION /usr/bin)
156 INSTALL(TARGETS ${TARGET_SEC_SRV_TC_SERVER_TESTS} DESTINATION /usr/bin)
157 INSTALL(TARGETS ${TARGET_SEC_SRV_PWD_TESTS} DESTINATION /usr/bin)
158 INSTALL(TARGETS ${TARGET_SEC_SRV_PRIVILEGE_TESTS} DESTINATION /usr/bin)
159 INSTALL(TARGETS ${TARGET_SEC_SRV_STRESS_TESTS} DESTINATION /usr/bin)
160 INSTALL(TARGETS ${TARGET_SEC_SRV_MT_TESTS} DESTINATION /usr/bin)
161 INSTALL(TARGETS ${TARGET_SEC_SRV_DBUS_TESTS} DESTINATION /usr/bin)
162 INSTALL(TARGETS ${TARGET_SEC_SRV_MEASURER} DESTINATION /usr/bin)
163
164 INSTALL(FILES
165     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/WRT_sstp_test_rules1.smack
166     DESTINATION /usr/share/privilege-control/
167 )
168
169 INSTALL(FILES
170     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/WRT_sstp_test_rules2.smack
171     DESTINATION /usr/share/privilege-control/
172 )