Introduce CynaraMask - a scoped cynara.service masker
[platform/core/test/security-tests.git] / tests / cynara-tests / CMakeLists.txt
1 # Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15
16 cmake_minimum_required(VERSION 2.8.3)
17
18 INCLUDE(FindPkgConfig)
19 SET(CYNARA_TARGET_TEST "cynara-test")
20
21 PKG_CHECK_MODULES(CYNARA_TARGET_DEP
22     REQUIRED
23     libprivilege-control
24     cynara-admin
25     cynara-client
26     cynara-client-async
27     cynara-plugin
28     dbus-1
29     )
30
31 #files to compile
32 SET(CYNARA_TARGET_TEST_SOURCES
33     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_admin.cpp
34     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client.cpp
35     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_client.cpp
36     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_request_monitor.cpp
37     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_client_async_status_monitor.cpp
38     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_commons.cpp
39     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_cynara_mask.cpp
40     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_env.cpp
41     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/cynara_test_file_operations.cpp
42     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/cynara-test.cpp
43     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases.cpp
44     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_async.cpp
45     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_db.cpp
46     )
47
48 #header directories
49 INCLUDE_DIRECTORIES(SYSTEM
50     ${CYNARA_TARGET_DEP_INCLUDE_DIRS}
51     )
52
53 INCLUDE_DIRECTORIES(
54     ${PROJECT_SOURCE_DIR}/tests/common/
55     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/
56     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/plugins/
57     )
58
59
60 #output format
61 ADD_EXECUTABLE(${CYNARA_TARGET_TEST} ${CYNARA_TARGET_TEST_SOURCES})
62
63 #linker directories
64 TARGET_LINK_LIBRARIES(${CYNARA_TARGET_TEST}
65     ${CYNARA_TARGET_DEP_LIBRARIES}
66     dpl-test-framework
67     tests-common
68     )
69
70 #place for output file
71 INSTALL(TARGETS ${CYNARA_TARGET_TEST}
72     DESTINATION /usr/bin
73     PERMISSIONS OWNER_READ
74                 OWNER_WRITE
75                 OWNER_EXECUTE
76                 GROUP_READ
77                 GROUP_EXECUTE
78                 WORLD_READ
79                 WORLD_EXECUTE
80     )
81
82 INSTALL(FILES
83     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/WRT_test_for_cynara_rules.smack
84     DESTINATION /usr/share/privilege-control/
85 )
86
87 INSTALL(DIRECTORY
88     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/db_patterns
89     DESTINATION /etc/security-tests/
90 )
91
92 ADD_SUBDIRECTORY(plugins)