Split PolicyResult declaration and definition
[platform/core/security/cynara.git] / test / CMakeLists.txt
1 # Copyright (c) 2014 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      Aleksander Zdyb <a.zdyb@samsung.com>
17 # @brief       Cmake for tests
18 #
19 PKG_CHECK_MODULES(PKGS REQUIRED gmock)
20
21 ADD_DEFINITIONS("-DCYNARA_NO_LOGS")
22 SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/src)
23
24 SET(CYNARA_SOURCES_FOR_TESTS
25     ${CYNARA_SRC}/common/types/PolicyBucket.cpp
26     ${CYNARA_SRC}/common/types/PolicyKey.cpp
27     ${CYNARA_SRC}/common/types/PolicyKeyHelpers.cpp
28     ${CYNARA_SRC}/common/types/PolicyResult.cpp
29     ${CYNARA_SRC}/common/types/PolicyType.cpp
30     ${CYNARA_SRC}/storage/BucketDeserializer.cpp
31     ${CYNARA_SRC}/storage/InMemoryStorageBackend.cpp
32     ${CYNARA_SRC}/storage/Storage.cpp
33     ${CYNARA_SRC}/storage/StorageDeserializer.cpp
34     ${CYNARA_SRC}/storage/StorageSerializer.cpp
35 )
36
37 SET(CYNARA_TESTS_SOURCES
38     common/exceptions/bucketrecordcorrupted.cpp
39     types/policykey.cpp
40     storage/performance/bucket.cpp
41     storage/storage/policies.cpp
42     storage/storage/check.cpp
43     storage/storage/buckets.cpp
44     storage/inmemorystoragebackend/inmemorystoragebackend.cpp
45     storage/inmemorystoragebackend/search.cpp
46     storage/inmemorystoragebackend/buckets.cpp
47     storage/serializer/bucket_load.cpp
48     storage/serializer/deserialize.cpp
49     storage/serializer/dump.cpp
50     storage/serializer/dump_load.cpp
51     storage/serializer/serialize.cpp
52     common/types/policybucket.cpp
53     helpers.cpp
54     TestEventListenerProxy.cpp
55     tests.cpp
56 )
57
58 INCLUDE_DIRECTORIES(
59     ${PKGS_INCLUDE_DIRS}
60     ${CYNARA_SRC}/common
61     ${CYNARA_SRC}/include
62     ${CYNARA_SRC}
63 )
64
65 ADD_EXECUTABLE(${TARGET_CYNARA_TESTS}
66     ${CYNARA_SOURCES_FOR_TESTS}
67     ${CYNARA_TESTS_SOURCES}
68 )
69
70 TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS}
71     ${PKGS_LDFLAGS} ${PKGS_LIBRARIES}
72 )
73 INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION ${BIN_INSTALL_DIR})