Rename StorageDeserializer to BucketDeserializer
[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@partner.samsung.com>
17 # @brief       Temporary cmake for tests
18 #
19
20 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
21 PROJECT("cynara-tests")
22
23 PKG_CHECK_MODULES(PKGS REQUIRED gmock_main)
24
25 SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/../src)
26
27 SET(CYNARA_SOURCES_FOR_TESTS
28     ${CYNARA_SRC}/service/storage/Storage.cpp
29     ${CYNARA_SRC}/common/types/PolicyBucket.cpp
30     ${CYNARA_SRC}/service/storage/InMemoryStorageBackend.cpp
31     ${CYNARA_SRC}/service/storage/BucketDeserializer.cpp
32     ${CYNARA_SRC}/service/storage/StorageSerializer.cpp
33     ${CYNARA_SRC}/common/types/PolicyKey.cpp
34     ${CYNARA_SRC}/common/types/PolicyType.cpp
35 )
36
37 SET(CYNARA_TESTS_SOURCES
38     common/exceptions/bucketrecordcorrupted.cpp
39     types/policykey.cpp
40     storage/storage/policies.cpp
41     storage/storage/check.cpp
42     storage/storage/buckets.cpp
43     storage/inmemorystoragebackend/inmemorystoragebackend.cpp
44     storage/inmemorystoragebackend/search.cpp
45     storage/inmemorystoragebackend/buckets.cpp
46     storage/serializer/bucket_load.cpp
47     storage/serializer/dump.cpp
48     common/types/policybucket.cpp
49     helpers.cpp
50 )
51
52 INCLUDE_DIRECTORIES(
53     ${PKGS_INCLUDE_DIRS}
54     ${CYNARA_SRC}
55     ${CYNARA_SRC}/common
56     ${CYNARA_SRC}/include
57     ${CYNARA_SRC}/service
58 )
59
60 ADD_EXECUTABLE(cynara-tests
61     ${CYNARA_SOURCES_FOR_TESTS}
62     ${CYNARA_TESTS_SOURCES}
63 )
64
65 SET(CMAKE_CXX_FLAGS "-std=c++0x -O0 -g -gdwarf-2")
66
67 FIND_PACKAGE(Threads)
68
69 TARGET_LINK_LIBRARIES(cynara-tests
70     ${CMAKE_THREAD_LIBS_INIT}
71     ${PKGS_LDFLAGS} ${PKGS_LIBRARIES}
72 )
73
74 INSTALL(TARGETS cynara-tests DESTINATION bin)