X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=test%2FCMakeLists.txt;h=5ab37d270c954cc59fdfaf171b5d2a3cfa3cb907;hb=3b6f95cd7abb9055555216aa30b0be6afee9af17;hp=d9ad4bdfdf715c51b2a16e151707c22ffea9f54e;hpb=b218185db0dcf6dc458d812e4eb338e1e69c7c76;p=platform%2Fcore%2Fsecurity%2Fcynara.git diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d9ad4bd..5ab37d2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,53 +13,106 @@ # limitations under the License. # # @file CMakeLists.txt -# @author Aleksander Zdyb -# @brief Temporary cmake for tests +# @author Aleksander Zdyb +# @author Radoslaw Bartosiak +# @brief Cmake for tests # +PKG_CHECK_MODULES(PKGS REQUIRED gmock) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3) -PROJECT("cynara-tests") - -ADD_SUBDIRECTORY(${GMOCK_DIR} gmock) +ADD_DEFINITIONS("-DCYNARA_NO_LOGS") +SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/src) SET(CYNARA_SOURCES_FOR_TESTS - ${CYNARA_SRC}/service/storage/Storage.cpp + ${CYNARA_SRC}/common/containers/BinaryQueue.cpp + ${CYNARA_SRC}/common/protocol/ProtocolAdmin.cpp + ${CYNARA_SRC}/common/protocol/ProtocolFrame.cpp + ${CYNARA_SRC}/common/protocol/ProtocolFrameHeader.cpp + ${CYNARA_SRC}/common/protocol/ProtocolFrameSerializer.cpp + ${CYNARA_SRC}/common/request/AdminCheckRequest.cpp + ${CYNARA_SRC}/common/request/DescriptionListRequest.cpp + ${CYNARA_SRC}/common/request/EraseRequest.cpp + ${CYNARA_SRC}/common/request/InsertOrUpdateBucketRequest.cpp + ${CYNARA_SRC}/common/request/ListRequest.cpp + ${CYNARA_SRC}/common/request/RemoveBucketRequest.cpp + ${CYNARA_SRC}/common/request/RequestTaker.cpp + ${CYNARA_SRC}/common/request/SetPoliciesRequest.cpp + ${CYNARA_SRC}/common/response/AdminCheckResponse.cpp + ${CYNARA_SRC}/common/response/DescriptionListResponse.cpp + ${CYNARA_SRC}/common/response/CheckResponse.cpp + ${CYNARA_SRC}/common/response/CodeResponse.cpp + ${CYNARA_SRC}/common/response/ListResponse.cpp + ${CYNARA_SRC}/common/response/ResponseTaker.cpp ${CYNARA_SRC}/common/types/PolicyBucket.cpp - ${CYNARA_SRC}/service/storage/InMemoryStorageBackend.cpp - ${CYNARA_SRC}/service/storage/StorageSerializer.cpp ${CYNARA_SRC}/common/types/PolicyKey.cpp + ${CYNARA_SRC}/common/types/PolicyKeyHelpers.cpp + ${CYNARA_SRC}/common/types/PolicyDescription.cpp + ${CYNARA_SRC}/common/types/PolicyResult.cpp + ${CYNARA_SRC}/common/types/PolicyType.cpp + ${CYNARA_SRC}/cyad/AdminPolicyParser.cpp + ${CYNARA_SRC}/cyad/CommandlineParser/CyadCommand.cpp + ${CYNARA_SRC}/cyad/CommandlineParser/CyadCommandlineParser.cpp + ${CYNARA_SRC}/cyad/CommandsDispatcher.cpp + ${CYNARA_SRC}/cyad/CynaraAdminPolicies.cpp + ${CYNARA_SRC}/helpers/creds-commons/CredsCommonsInner.cpp + ${CYNARA_SRC}/helpers/creds-commons/creds-commons.cpp + ${CYNARA_SRC}/storage/BucketDeserializer.cpp + ${CYNARA_SRC}/storage/InMemoryStorageBackend.cpp + ${CYNARA_SRC}/storage/Integrity.cpp + ${CYNARA_SRC}/storage/Storage.cpp + ${CYNARA_SRC}/storage/StorageDeserializer.cpp + ${CYNARA_SRC}/storage/StorageSerializer.cpp ) SET(CYNARA_TESTS_SOURCES - types/policykey.cpp + TestEventListenerProxy.cpp + common/exceptions/bucketrecordcorrupted.cpp + common/protocols/admin/admincheckrequest.cpp + common/protocols/admin/admincheckresponse.cpp + common/protocols/admin/descriptionlistrequest.cpp + common/protocols/admin/descriptionlistresponse.cpp + common/protocols/admin/eraserequest.cpp + common/protocols/admin/listrequest.cpp + common/protocols/admin/listresponse.cpp + common/types/policybucket.cpp + credsCommons/parser/Parser.cpp + cyad/commandline.cpp + cyad/commandline_errors.cpp + cyad/commands_dispatcher.cpp + cyad/helpers.cpp + cyad/policy_collection.cpp + cyad/policy_parser.cpp + helpers.cpp + storage/performance/bucket.cpp storage/storage/policies.cpp storage/storage/check.cpp storage/storage/buckets.cpp storage/inmemorystoragebackend/inmemorystoragebackend.cpp storage/inmemorystoragebackend/search.cpp storage/inmemorystoragebackend/buckets.cpp + storage/serializer/bucket_load.cpp + storage/serializer/deserialize.cpp storage/serializer/dump.cpp - helpers.cpp + storage/serializer/dump_load.cpp + storage/serializer/serialize.cpp + tests.cpp + types/policykey.cpp ) INCLUDE_DIRECTORIES( - ${GMOCK_DIR}/include - ${GMOCK_DIR}/gtest/include - ${CYNARA_SRC} + ${PKGS_INCLUDE_DIRS} ${CYNARA_SRC}/common ${CYNARA_SRC}/include + ${CYNARA_SRC} + credsCommons/parser + common/protocols ) -ADD_EXECUTABLE(cynara-tests +ADD_EXECUTABLE(${TARGET_CYNARA_TESTS} ${CYNARA_SOURCES_FOR_TESTS} ${CYNARA_TESTS_SOURCES} ) -SET(CMAKE_CXX_FLAGS "-std=c++0x -O0 -g -gdwarf-2") - -FIND_PACKAGE(Threads) - -TARGET_LINK_LIBRARIES(cynara-tests - ${CMAKE_THREAD_LIBS_INIT} - gmock gtest_main +TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS} + ${PKGS_LDFLAGS} ${PKGS_LIBRARIES} ) +INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION ${BIN_INSTALL_DIR})