Extend AppInstallHelper with checker methods
[platform/core/test/security-tests.git] / src / security-manager-tests / CMakeLists.txt
1 # Copyright (c) 2014-2020 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 # @file        CMakeLists.txt
16 # @author      Marcin Niesluchowski (m.niesluchow@samsung.com)
17 # @brief
18 #
19
20 INCLUDE(FindPkgConfig)
21
22 # Dependencies
23 PKG_CHECK_MODULES(SEC_MGR_TESTS_DEP
24     REQUIRED
25     libsmack
26     cynara-client
27     cynara-admin
28     security-manager
29     security-privilege-manager
30     libtzplatform-config
31     sqlite3
32     libcap
33     dbus-1
34     libgum)
35
36
37 SET(TARGET_SEC_MGR_TESTS "security-manager-tests")
38
39 SET(SEC_MGR_SOURCES
40     ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_cynara_mask.cpp
41     ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_commons.cpp
42     ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_file_operations.cpp
43     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases.cpp
44     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_app_defined_privilege.cpp
45     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_app_policy.cpp
46     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_credentials.cpp
47     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_dyntransition.cpp
48     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_nss.cpp
49     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_paths.cpp
50     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_privacy_manager.cpp
51     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_private_sharing.cpp
52     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_public_sharing.cpp
53     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_register_paths.cpp
54     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_shm.cpp
55     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_trusted_sharing.cpp
56     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/test_cases_prepare_app.cpp
57     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/security_manager_tests.cpp
58     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/common/policy_configuration.cpp
59     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/common/sm_commons.cpp
60     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/common/template_parser.cpp
61     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/common/scoped_app_launcher.cpp
62     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/common/app_install_helper_ext.cpp
63     ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_client.cpp
64     ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/cynara_test_admin.cpp
65     ${PROJECT_SOURCE_DIR}/src/cynara-tests/plugins/plugins.cpp
66    )
67
68 INCLUDE_DIRECTORIES(SYSTEM
69     ${SEC_MGR_TESTS_DEP_INCLUDE_DIRS}
70    )
71
72 INCLUDE_DIRECTORIES(SYSTEM
73     ${CYNARA_TARGET_DEP_INCLUDE_DIRS}
74     )
75
76 INCLUDE_DIRECTORIES(
77     ${PROJECT_SOURCE_DIR}/src/common/
78     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/common/
79     ${PROJECT_SOURCE_DIR}/src/cynara-tests/common/
80     ${PROJECT_SOURCE_DIR}/src/cynara-tests/plugins/
81    )
82
83 FIND_PACKAGE(Threads)
84
85 ADD_EXECUTABLE(${TARGET_SEC_MGR_TESTS} ${SEC_MGR_SOURCES})
86
87 TARGET_LINK_LIBRARIES(${TARGET_SEC_MGR_TESTS}
88     ${SEC_MGR_TESTS_DEP_LIBRARIES}
89     dpl-test-framework
90     tests-common
91     rt
92     ${CMAKE_THREAD_LIBS_INIT}
93     )
94
95 INSTALL(TARGETS ${TARGET_SEC_MGR_TESTS} DESTINATION /usr/bin)
96
97 INSTALL(DIRECTORY
98     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/app_files/
99     DESTINATION ${GLOBAL_APP_DIR}
100 )
101
102 INSTALL(DIRECTORY
103     ${PROJECT_SOURCE_DIR}/src/security-manager-tests/app_files/
104     DESTINATION ${LOCAL_APP_DIR}
105 )