Prevent running perm_add_additional_rules_smack_access_*
[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_STRESS_TESTS "security-server-tests-stress")
42 SET(TARGET_SEC_SRV_MT_TESTS "security-server-tests-mt")
43 SET(TARGET_SEC_SRV_DBUS_TESTS "security-server-tests-dbus")
44 SET(TARGET_SEC_SRV_MEASURER "security-server-tests-api-speed")
45
46
47 # Sources definition
48
49 SET(SEC_SRV_COMMON_SOURCES
50     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/common/security_server_tests_common.cpp
51    )
52
53 SET(SEC_SRV_CLIENT_SMACK_SOURCES
54     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_client_smack.cpp
55     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp
56    )
57
58 SET(SEC_SRV_TC_SERVER_SOURCES
59     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/server.cpp
60     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/open_for.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_STRESS_SOURCES
72     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_stress.cpp
73    )
74
75 SET(SEC_SRV_MT_SOURCES
76     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_mt.cpp
77    )
78
79 SET(SEC_SRV_DBUS_SOURCES
80     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_dbus.cpp
81    )
82
83 SET(SEC_SRV_MEASURER_SOURCES
84     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_measurer_API_speed.cpp
85     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp
86    )
87
88 INCLUDE_DIRECTORIES(SYSTEM
89     ${SEC_SRV_TESTS_DEP_INCLUDE_DIRS}
90    )
91
92 INCLUDE_DIRECTORIES(
93     ${PROJECT_SOURCE_DIR}/tests/common/
94     ${PROJECT_SOURCE_DIR}/tests/security-server-tests/common/
95    )
96
97 ADD_DEFINITIONS("-I/usr/include/dbus-1.0/dbus")
98
99 #LINK_DIRECTORIES(${SEC_SRV_PKGS_LIBRARY_DIRS})
100
101 ADD_LIBRARY(${TARGET_SEC_SRV_COMMON} STATIC ${SEC_SRV_COMMON_SOURCES})
102 ADD_EXECUTABLE(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS} ${SEC_SRV_CLIENT_SMACK_SOURCES})
103 ADD_EXECUTABLE(${TARGET_SEC_SRV_TC_SERVER_TESTS} ${SEC_SRV_TC_SERVER_SOURCES})
104 ADD_EXECUTABLE(${TARGET_SEC_SRV_PWD_TESTS} ${SEC_SRV_PWD_SOURCES})
105 ADD_EXECUTABLE(${TARGET_SEC_SRV_STRESS_TESTS} ${SEC_SRV_STRESS_SOURCES})
106 ADD_EXECUTABLE(${TARGET_SEC_SRV_MT_TESTS} ${SEC_SRV_MT_SOURCES})
107 ADD_EXECUTABLE(${TARGET_SEC_SRV_DBUS_TESTS} ${SEC_SRV_DBUS_SOURCES})
108 ADD_EXECUTABLE(${TARGET_SEC_SRV_MEASURER} ${SEC_SRV_MEASURER_SOURCES})
109
110
111 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_CLIENT_SMACK_TESTS}
112     ${SEC_SRV_TESTS_DEP_LIBRARIES}
113     tests-common)
114
115 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_TC_SERVER_TESTS}
116     ${TARGET_SEC_SRV_COMMON}
117     ${SEC_SRV_TESTS_DEP_LIBRARIES}
118     tests-common)
119
120 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_PWD_TESTS}
121     ${TARGET_SEC_SRV_COMMON}
122     ${SEC_SRV_TESTS_DEP_LIBRARIES}
123     tests-common)
124
125 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_STRESS_TESTS}
126     ${SEC_SRV_TESTS_DEP_LIBRARIES}
127     tests-common)
128
129 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MT_TESTS}
130     ${SEC_SRV_TESTS_DEP_LIBRARIES}
131     tests-common)
132
133 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_DBUS_TESTS}
134     ${SEC_SRV_TESTS_DEP_LIBRARIES}
135     tests-common)
136
137 TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MEASURER}
138     ${SEC_SRV_TESTS_DEP_LIBRARIES}
139     tests-common)
140
141 # Installation
142
143 INSTALL(TARGETS ${TARGET_SEC_SRV_CLIENT_SMACK_TESTS} DESTINATION /usr/bin)
144 INSTALL(TARGETS ${TARGET_SEC_SRV_TC_SERVER_TESTS} DESTINATION /usr/bin)
145 INSTALL(TARGETS ${TARGET_SEC_SRV_PWD_TESTS} DESTINATION /usr/bin)
146 INSTALL(TARGETS ${TARGET_SEC_SRV_STRESS_TESTS} DESTINATION /usr/bin)
147 INSTALL(TARGETS ${TARGET_SEC_SRV_MT_TESTS} DESTINATION /usr/bin)
148 INSTALL(TARGETS ${TARGET_SEC_SRV_DBUS_TESTS} DESTINATION /usr/bin)
149 INSTALL(TARGETS ${TARGET_SEC_SRV_MEASURER} DESTINATION /usr/bin)