1 # Copyright (c) 2014-2015 Samsung Electronics Co., Ltd All Rights Reserved
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 # @file CMakeLists.txt
16 # @author Aleksander Zdyb <a.zdyb@samsung.com>
17 # @author Radoslaw Bartosiak <r.bartosiak@samsung.com>
18 # @brief Cmake for tests
20 PKG_CHECK_MODULES(PKGS REQUIRED gmock)
22 ADD_DEFINITIONS("-DCYNARA_NO_LOGS")
23 SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/src)
25 SET(CYNARA_SOURCES_FOR_TESTS
26 ${CYNARA_SRC}/common/config/PathConfig.cpp
27 ${CYNARA_SRC}/common/containers/BinaryQueue.cpp
28 ${CYNARA_SRC}/common/protocol/ProtocolAdmin.cpp
29 ${CYNARA_SRC}/common/protocol/ProtocolFrame.cpp
30 ${CYNARA_SRC}/common/protocol/ProtocolFrameHeader.cpp
31 ${CYNARA_SRC}/common/protocol/ProtocolFrameSerializer.cpp
32 ${CYNARA_SRC}/common/request/AdminCheckRequest.cpp
33 ${CYNARA_SRC}/common/request/DescriptionListRequest.cpp
34 ${CYNARA_SRC}/common/request/EraseRequest.cpp
35 ${CYNARA_SRC}/common/request/InsertOrUpdateBucketRequest.cpp
36 ${CYNARA_SRC}/common/request/ListRequest.cpp
37 ${CYNARA_SRC}/common/request/RemoveBucketRequest.cpp
38 ${CYNARA_SRC}/common/request/RequestTaker.cpp
39 ${CYNARA_SRC}/common/request/SetPoliciesRequest.cpp
40 ${CYNARA_SRC}/common/response/AdminCheckResponse.cpp
41 ${CYNARA_SRC}/common/response/DescriptionListResponse.cpp
42 ${CYNARA_SRC}/common/response/CheckResponse.cpp
43 ${CYNARA_SRC}/common/response/CodeResponse.cpp
44 ${CYNARA_SRC}/common/response/ListResponse.cpp
45 ${CYNARA_SRC}/common/response/ResponseTaker.cpp
46 ${CYNARA_SRC}/common/types/PolicyBucket.cpp
47 ${CYNARA_SRC}/common/types/PolicyKey.cpp
48 ${CYNARA_SRC}/common/types/PolicyKeyHelpers.cpp
49 ${CYNARA_SRC}/common/types/PolicyDescription.cpp
50 ${CYNARA_SRC}/common/types/PolicyResult.cpp
51 ${CYNARA_SRC}/common/types/PolicyType.cpp
52 ${CYNARA_SRC}/chsgen/ChecksumGenerator.cpp
53 ${CYNARA_SRC}/cyad/AdminPolicyParser.cpp
54 ${CYNARA_SRC}/cyad/CommandlineParser/CmdlineErrors.cpp
55 ${CYNARA_SRC}/cyad/CommandlineParser/CmdlineOpts.cpp
56 ${CYNARA_SRC}/cyad/CommandlineParser/CyadCommand.cpp
57 ${CYNARA_SRC}/cyad/CommandlineParser/CyadCommandlineParser.cpp
58 ${CYNARA_SRC}/cyad/CommandlineParser/HumanReadableParser.cpp
59 ${CYNARA_SRC}/cyad/CommandsDispatcher.cpp
60 ${CYNARA_SRC}/cyad/CynaraAdminPolicies.cpp
61 ${CYNARA_SRC}/cyad/PolicyTypeTranslator.cpp
62 ${CYNARA_SRC}/helpers/creds-commons/CredsCommonsInner.cpp
63 ${CYNARA_SRC}/helpers/creds-commons/creds-commons.cpp
64 ${CYNARA_SRC}/service/main/CmdlineParser.cpp
65 ${CYNARA_SRC}/storage/BucketDeserializer.cpp
66 ${CYNARA_SRC}/storage/ChecksumValidator.cpp
67 ${CYNARA_SRC}/storage/InMemoryStorageBackend.cpp
68 ${CYNARA_SRC}/storage/Integrity.cpp
69 ${CYNARA_SRC}/storage/Storage.cpp
70 ${CYNARA_SRC}/storage/StorageDeserializer.cpp
73 SET(CYNARA_TESTS_SOURCES
74 TestEventListenerProxy.cpp
75 chsgen/checksumgenerator.cpp
76 common/exceptions/bucketrecordcorrupted.cpp
77 common/protocols/admin/admincheckrequest.cpp
78 common/protocols/admin/admincheckresponse.cpp
79 common/protocols/admin/descriptionlistrequest.cpp
80 common/protocols/admin/descriptionlistresponse.cpp
81 common/protocols/admin/eraserequest.cpp
82 common/protocols/admin/listrequest.cpp
83 common/protocols/admin/listresponse.cpp
84 common/types/policybucket.cpp
85 credsCommons/parser/Parser.cpp
87 cyad/commandline_errors.cpp
88 cyad/commands_dispatcher.cpp
90 cyad/policy_collection.cpp
91 cyad/policy_parser.cpp
93 service/main/cmdlineparser.cpp
94 storage/checksum/checksumvalidator.cpp
95 storage/performance/bucket.cpp
96 storage/storage/policies.cpp
97 storage/storage/check.cpp
98 storage/storage/buckets.cpp
99 storage/inmemorystoragebackend/inmemorystoragebackend.cpp
100 storage/inmemorystoragebackend/search.cpp
101 storage/inmemorystoragebackend/buckets.cpp
102 storage/serializer/bucket_load.cpp
103 storage/serializer/deserialize.cpp
104 storage/serializer/dump.cpp
105 storage/serializer/dump_load.cpp
106 storage/serializer/serialize.cpp
111 SET(CYNARA_MIGRATION_TOOL_TESTS tools/cynara-db-migration-tests)
116 ${CYNARA_SRC}/include
123 ADD_EXECUTABLE(${TARGET_CYNARA_TESTS}
124 ${CYNARA_SOURCES_FOR_TESTS}
125 ${CYNARA_TESTS_SOURCES}
128 TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS}
133 INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION ${BIN_INSTALL_DIR})
135 INSTALL(FILES ${CYNARA_MIGRATION_TOOL_TESTS} DESTINATION ${BIN_INSTALL_DIR})