Add test cynara service plugins
[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_env.cpp
40     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/cynara-test.cpp
41     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases.cpp
42     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_async.cpp
43     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/test_cases_db.cpp
44     )
45
46 #header directories
47 INCLUDE_DIRECTORIES(SYSTEM
48     ${CYNARA_TARGET_DEP_INCLUDE_DIRS}
49     )
50
51 INCLUDE_DIRECTORIES(
52     ${PROJECT_SOURCE_DIR}/tests/common/
53     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/common/
54     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/plugins/
55     )
56
57
58 #output format
59 ADD_EXECUTABLE(${CYNARA_TARGET_TEST} ${CYNARA_TARGET_TEST_SOURCES})
60
61 #linker directories
62 TARGET_LINK_LIBRARIES(${CYNARA_TARGET_TEST}
63     ${CYNARA_TARGET_DEP_LIBRARIES}
64     dpl-test-framework
65     tests-common
66     )
67
68 #place for output file
69 INSTALL(TARGETS ${CYNARA_TARGET_TEST}
70     DESTINATION /usr/bin
71     PERMISSIONS OWNER_READ
72                 OWNER_WRITE
73                 OWNER_EXECUTE
74                 GROUP_READ
75                 GROUP_EXECUTE
76                 WORLD_READ
77                 WORLD_EXECUTE
78     )
79
80 INSTALL(FILES
81     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/WRT_test_for_cynara_rules.smack
82     DESTINATION /usr/share/privilege-control/
83 )
84
85 INSTALL(DIRECTORY
86     ${PROJECT_SOURCE_DIR}/tests/cynara-tests/db_patterns
87     DESTINATION /etc/security-tests/
88 )
89
90 ADD_SUBDIRECTORY(plugins)