SET(TARGET_LIB_CYNARA "cynara-client")
SET(TARGET_LIB_CYNARA_ADMIN "cynara-admin")
SET(TARGET_CYNARA_COMMON "cynara-commons")
+SET(TARGET_CYNARA_TESTS "cynara-tests")
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(build)
#
# @file CMakeLists.txt
# @author Aleksander Zdyb <a.zdyb@partner.samsung.com>
-# @brief Temporary cmake for tests
+# @brief Cmake for tests
#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
-PROJECT("cynara-tests")
-
PKG_CHECK_MODULES(PKGS REQUIRED gmock_main)
-SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/../src)
+SET(CYNARA_SRC ${PROJECT_SOURCE_DIR}/src)
SET(CYNARA_SOURCES_FOR_TESTS
${CYNARA_SRC}/service/storage/Storage.cpp
INCLUDE_DIRECTORIES(
${PKGS_INCLUDE_DIRS}
- ${CYNARA_SRC}
${CYNARA_SRC}/common
${CYNARA_SRC}/include
${CYNARA_SRC}/service
)
-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}
+TARGET_LINK_LIBRARIES(${TARGET_CYNARA_TESTS}
${PKGS_LDFLAGS} ${PKGS_LIBRARIES}
)
-
-INSTALL(TARGETS cynara-tests DESTINATION bin)
+INSTALL(TARGETS ${TARGET_CYNARA_TESTS} DESTINATION bin)
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "common/exceptions/BucketRecordCorruptedException.h"
+#include "exceptions/BucketRecordCorruptedException.h"
using namespace Cynara;
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "common/types/PolicyBucket.h"
-#include "common/types/PolicyKey.h"
-#include "common/types/PolicyCollection.h"
+#include "types/PolicyBucket.h"
+#include "types/PolicyKey.h"
+#include "types/PolicyCollection.h"
#include "../../helpers.h"
#include "helpers.h"
-#include "common/types/PolicyKey.h"
+#include "types/PolicyKey.h"
namespace Cynara {
namespace Helpers {
#ifndef HELPERS_H
#define HELPERS_H
-#include "common/types/PolicyKey.h"
-#include "common/types/PolicyBucketId.h"
+#include "types/PolicyKey.h"
+#include "types/PolicyBucketId.h"
namespace Cynara {
namespace Helpers {
#include "inmemeorystoragebackendfixture.h"
#include "fakeinmemorystoragebackend.h"
-#include "common/types/PolicyResult.h"
-#include "common/types/PolicyBucket.h"
+#include "types/PolicyResult.h"
+#include "types/PolicyBucket.h"
using namespace Cynara;
#ifndef FAKEINMEMORYSTORAGEBACKEND_H_
#define FAKEINMEMORYSTORAGEBACKEND_H_
-#include "service/storage/InMemoryStorageBackend.h"
+#include "storage/InMemoryStorageBackend.h"
class FakeInMemoryStorageBackend : public Cynara::InMemoryStorageBackend {
public:
#include "gmock/gmock.h"
-#include "common/types/PolicyBucket.h"
-#include "common/types/PolicyCollection.h"
-#include "service/storage/InMemoryStorageBackend.h"
+#include "types/PolicyBucket.h"
+#include "types/PolicyCollection.h"
+#include "storage/InMemoryStorageBackend.h"
class InMemeoryStorageBackendFixture : public ::testing::Test {
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "common/types/PolicyType.h"
-#include "common/types/PolicyKey.h"
-#include "common/types/PolicyResult.h"
-#include "common/types/PolicyCollection.h"
-#include "common/exceptions/DefaultBucketDeletionException.h"
-#include "common/exceptions/BucketAlreadyExistsException.h"
-#include "common/exceptions/BucketNotExistsException.h"
-#include "service/storage/StorageBackend.h"
-#include "service/storage/InMemoryStorageBackend.h"
+#include "types/PolicyType.h"
+#include "types/PolicyKey.h"
+#include "types/PolicyResult.h"
+#include "types/PolicyCollection.h"
+#include "exceptions/DefaultBucketDeletionException.h"
+#include "exceptions/BucketAlreadyExistsException.h"
+#include "exceptions/BucketNotExistsException.h"
+#include "storage/StorageBackend.h"
+#include "storage/InMemoryStorageBackend.h"
#include "../../helpers.h"
#include "fakeinmemorystoragebackend.h"
#include "inmemeorystoragebackendfixture.h"
#include "fakeinmemorystoragebackend.h"
-#include "common/types/PolicyBucket.h"
+#include "types/PolicyBucket.h"
#include "../../helpers.h"
#include <gtest/gtest.h>
#include <exceptions/BucketRecordCorruptedException.h>
-#include <service/storage/BucketDeserializer.h>
+#include <storage/BucketDeserializer.h>
#include <types/Policy.h>
#include "../../helpers.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "service/storage/StorageSerializer.h"
-#include "common/types/PolicyBucket.h"
-#include "common/types/PolicyType.h"
-#include "common/types/PolicyKey.h"
-#include "common/types/Policy.h"
+#include "storage/StorageSerializer.h"
+#include "types/PolicyBucket.h"
+#include "types/PolicyType.h"
+#include "types/PolicyKey.h"
+#include "types/Policy.h"
#include "../../helpers.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "common/types/PolicyType.h"
-#include "common/types/PolicyKey.h"
-#include "common/types/PolicyResult.h"
-#include "common/types/PolicyCollection.h"
-#include "common/types/pointers.h"
-#include "common/exceptions/DefaultBucketDeletionException.h"
-#include "common/exceptions/BucketAlreadyExistsException.h"
-#include "service/storage/Storage.h"
-#include "service/storage/StorageBackend.h"
+#include "types/PolicyType.h"
+#include "types/PolicyKey.h"
+#include "types/PolicyResult.h"
+#include "types/PolicyCollection.h"
+#include "types/pointers.h"
+#include "exceptions/DefaultBucketDeletionException.h"
+#include "exceptions/BucketAlreadyExistsException.h"
+#include "storage/Storage.h"
+#include "storage/StorageBackend.h"
#include "fakestoragebackend.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "common/types/PolicyType.h"
-#include "common/types/PolicyKey.h"
-#include "common/types/PolicyResult.h"
-#include "common/types/PolicyCollection.h"
-#include "common/types/pointers.h"
-#include "common/exceptions/DefaultBucketDeletionException.h"
-#include "common/exceptions/BucketAlreadyExistsException.h"
-#include "service/storage/Storage.h"
-#include "service/storage/StorageBackend.h"
+#include "types/PolicyType.h"
+#include "types/PolicyKey.h"
+#include "types/PolicyResult.h"
+#include "types/PolicyCollection.h"
+#include "types/pointers.h"
+#include "exceptions/DefaultBucketDeletionException.h"
+#include "exceptions/BucketAlreadyExistsException.h"
+#include "storage/Storage.h"
+#include "storage/StorageBackend.h"
#include "fakestoragebackend.h"
#include "../../helpers.h"
#include <gtest/gtest.h>
#include <gmock/gmock.h>
-#include "common/types/PolicyType.h"
-#include "common/types/PolicyKey.h"
-#include "common/types/PolicyResult.h"
-#include "common/types/PolicyCollection.h"
-#include "common/types/pointers.h"
-#include "common/exceptions/DefaultBucketDeletionException.h"
-#include "common/exceptions/BucketAlreadyExistsException.h"
-#include "service/storage/Storage.h"
-#include "service/storage/StorageBackend.h"
+#include "types/PolicyType.h"
+#include "types/PolicyKey.h"
+#include "types/PolicyResult.h"
+#include "types/PolicyCollection.h"
+#include "types/pointers.h"
+#include "exceptions/DefaultBucketDeletionException.h"
+#include "exceptions/BucketAlreadyExistsException.h"
+#include "storage/Storage.h"
+#include "storage/StorageBackend.h"
#include "fakestoragebackend.h"
#include "../helpers.h"
-#include "common/types/PolicyKey.h"
+#include "types/PolicyKey.h"
using namespace Cynara;