Add CyadCommandlineParser
[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 # @author      Radoslaw Bartosiak <r.bartosiak@samsung.com>
18 # @brief       Cmake for tests
19 #
20 PKG_CHECK_MODULES(PKGS REQUIRED gmock)
21
22 ADD_DEFINITIONS("-DCYNARA_NO_LOGS")
23 SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/src)
24
25 SET(CYNARA_SOURCES_FOR_TESTS
26     ${CYNARA_SRC}/common/containers/BinaryQueue.cpp
27     ${CYNARA_SRC}/common/protocol/ProtocolAdmin.cpp
28     ${CYNARA_SRC}/common/protocol/ProtocolFrame.cpp
29     ${CYNARA_SRC}/common/protocol/ProtocolFrameHeader.cpp
30     ${CYNARA_SRC}/common/protocol/ProtocolFrameSerializer.cpp
31     ${CYNARA_SRC}/common/request/AdminCheckRequest.cpp
32     ${CYNARA_SRC}/common/request/DescriptionListRequest.cpp
33     ${CYNARA_SRC}/common/request/EraseRequest.cpp
34     ${CYNARA_SRC}/common/request/InsertOrUpdateBucketRequest.cpp
35     ${CYNARA_SRC}/common/request/ListRequest.cpp
36     ${CYNARA_SRC}/common/request/RemoveBucketRequest.cpp
37     ${CYNARA_SRC}/common/request/RequestTaker.cpp
38     ${CYNARA_SRC}/common/request/SetPoliciesRequest.cpp
39     ${CYNARA_SRC}/common/response/AdminCheckResponse.cpp
40     ${CYNARA_SRC}/common/response/DescriptionListResponse.cpp
41     ${CYNARA_SRC}/common/response/CheckResponse.cpp
42     ${CYNARA_SRC}/common/response/CodeResponse.cpp
43     ${CYNARA_SRC}/common/response/ListResponse.cpp
44     ${CYNARA_SRC}/common/response/ResponseTaker.cpp
45     ${CYNARA_SRC}/common/types/PolicyBucket.cpp
46     ${CYNARA_SRC}/common/types/PolicyKey.cpp
47     ${CYNARA_SRC}/common/types/PolicyKeyHelpers.cpp
48     ${CYNARA_SRC}/common/types/PolicyDescription.cpp
49     ${CYNARA_SRC}/common/types/PolicyResult.cpp
50     ${CYNARA_SRC}/common/types/PolicyType.cpp
51     ${CYNARA_SRC}/cyad/AdminPolicyParser.cpp
52     ${CYNARA_SRC}/cyad/CommandlineParser/CyadCommand.cpp
53     ${CYNARA_SRC}/cyad/CommandlineParser/CyadCommandlineParser.cpp
54     ${CYNARA_SRC}/cyad/CommandsDispatcher.cpp
55     ${CYNARA_SRC}/cyad/CynaraAdminPolicies.cpp
56     ${CYNARA_SRC}/helpers/creds-commons/CredsCommonsInner.cpp
57     ${CYNARA_SRC}/helpers/creds-commons/creds-commons.cpp
58     ${CYNARA_SRC}/storage/BucketDeserializer.cpp
59     ${CYNARA_SRC}/storage/InMemoryStorageBackend.cpp
60     ${CYNARA_SRC}/storage/Integrity.cpp
61     ${CYNARA_SRC}/storage/Storage.cpp
62     ${CYNARA_SRC}/storage/StorageDeserializer.cpp
63     ${CYNARA_SRC}/storage/StorageSerializer.cpp
64 )
65
66 SET(CYNARA_TESTS_SOURCES
67     TestEventListenerProxy.cpp
68     common/exceptions/bucketrecordcorrupted.cpp
69     common/protocols/admin/admincheckrequest.cpp
70     common/protocols/admin/admincheckresponse.cpp
71     common/protocols/admin/descriptionlistrequest.cpp
72     common/protocols/admin/descriptionlistresponse.cpp
73     common/protocols/admin/eraserequest.cpp
74     common/protocols/admin/listrequest.cpp
75     common/protocols/admin/listresponse.cpp
76     common/types/policybucket.cpp
77     credsCommons/parser/Parser.cpp
78     cyad/commandline.cpp
79     cyad/commandline_errors.cpp
80     cyad/commands_dispatcher.cpp
81     cyad/helpers.cpp
82     cyad/policy_collection.cpp
83     cyad/policy_parser.cpp
84     helpers.cpp
85     storage/performance/bucket.cpp
86     storage/storage/policies.cpp
87     storage/storage/check.cpp
88     storage/storage/buckets.cpp
89     storage/inmemorystoragebackend/inmemorystoragebackend.cpp
90     storage/inmemorystoragebackend/search.cpp
91     storage/inmemorystoragebackend/buckets.cpp
92     storage/serializer/bucket_load.cpp
93     storage/serializer/deserialize.cpp
94     storage/serializer/dump.cpp
95     storage/serializer/dump_load.cpp
96     storage/serializer/serialize.cpp
97     tests.cpp
98     types/policykey.cpp
99 )
100
101 INCLUDE_DIRECTORIES(
102     ${PKGS_INCLUDE_DIRS}
103     ${CYNARA_SRC}/common
104     ${CYNARA_SRC}/include
105     ${CYNARA_SRC}
106     credsCommons/parser
107     common/protocols
108 )
109
110 ADD_EXECUTABLE(${TARGET_CYNARA_TESTS}
111     ${CYNARA_SOURCES_FOR_TESTS}
112     ${CYNARA_TESTS_SOURCES}
113 )
114
115 TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS}
116     ${PKGS_LDFLAGS} ${PKGS_LIBRARIES}
117 )
118 INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION ${BIN_INSTALL_DIR})