1 PKG_CHECK_MODULES(KEY_MANAGER_TEST_DEP
6 FIND_PACKAGE(Threads REQUIRED)
7 ADD_DEFINITIONS("-DBOOST_TEST_DYN_LINK")
9 SET(DB_TEST_DIR ${TEST_DIR}/db)
10 SET(SS_TEST_DIR ${TEST_DIR}/secure-storage)
12 ADD_DEFINITIONS("-DDB_TEST_DIR=\"${DB_TEST_DIR}\"")
13 ADD_DEFINITIONS("-DSS_TEST_DIR=\"${SS_TEST_DIR}\"")
15 SET(KEY_MANAGER_SRC_PATH ${PROJECT_SOURCE_DIR}/src)
16 SET(KEY_MANAGER_PATH ${PROJECT_SOURCE_DIR}/src/manager)
18 SET(TARGET_ENCRYPTION_SCHEME_COMMON encryption-scheme-common)
20 ################################################################################
23 SET(KEY_MANAGER_TEST_MERGED_SRC ${PROJECT_SOURCE_DIR}/tests)
26 ${KEY_MANAGER_DEP_INCLUDE_DIRS}
27 ${KEY_MANAGER_PATH}/dpl/db/include
28 ${KEY_MANAGER_PATH}/dpl/core/include
29 ${KEY_MANAGER_PATH}/dpl/log/include
30 ${KEY_MANAGER_PATH}/sqlcipher
31 ${KEY_MANAGER_PATH}/service
32 ${KEY_MANAGER_PATH}/initial-values
33 ${KEY_MANAGER_PATH}/main
34 ${KEY_MANAGER_PATH}/common
35 ${KEY_MANAGER_PATH}/crypto
36 ${KEY_MANAGER_PATH}/client-async
37 ${KEY_MANAGER_SRC_PATH}/include
38 ${KEY_MANAGER_TEST_MERGED_SRC}
39 ${KEY_MANAGER_TEST_MERGED_SRC}/encryption-scheme
42 SET(TEST_MERGED_SOURCES
43 ${KEY_MANAGER_TEST_MERGED_SRC}/colour_log_formatter.cpp
44 ${KEY_MANAGER_TEST_MERGED_SRC}/DBFixture.cpp
45 ${KEY_MANAGER_TEST_MERGED_SRC}/main.cpp
46 ${KEY_MANAGER_TEST_MERGED_SRC}/test_async-observer.cpp
47 ${KEY_MANAGER_TEST_MERGED_SRC}/test_base64.cpp
48 ${KEY_MANAGER_TEST_MERGED_SRC}/test_binary-queue.cpp
49 ${KEY_MANAGER_TEST_MERGED_SRC}/test_certificate.cpp
50 ${KEY_MANAGER_TEST_MERGED_SRC}/test_comm-manager.cpp
51 ${KEY_MANAGER_TEST_MERGED_SRC}/test_common.cpp
52 ${KEY_MANAGER_TEST_MERGED_SRC}/test_crypto-logic.cpp
53 ${KEY_MANAGER_TEST_MERGED_SRC}/test_data-type.cpp
54 ${KEY_MANAGER_TEST_MERGED_SRC}/test_db_crypto.cpp
55 ${KEY_MANAGER_TEST_MERGED_SRC}/test_descriptor-set.cpp
56 ${KEY_MANAGER_TEST_MERGED_SRC}/test_dpl-db.cpp
57 ${KEY_MANAGER_TEST_MERGED_SRC}/test_dpl-exception.cpp
58 ${KEY_MANAGER_TEST_MERGED_SRC}/test_encryption-scheme.cpp
59 ${KEY_MANAGER_TEST_MERGED_SRC}/test_exception.cpp
60 ${KEY_MANAGER_TEST_MERGED_SRC}/test_for-each-file.cpp
61 ${KEY_MANAGER_TEST_MERGED_SRC}/test_generic-backend.cpp
62 ${KEY_MANAGER_TEST_MERGED_SRC}/test_key.cpp
63 ${KEY_MANAGER_TEST_MERGED_SRC}/test_key-provider.cpp
64 ${KEY_MANAGER_TEST_MERGED_SRC}/test_log-provider.cpp
65 ${KEY_MANAGER_TEST_MERGED_SRC}/test_safe-buffer.cpp
66 ${KEY_MANAGER_TEST_MERGED_SRC}/test_serialization.cpp
67 ${KEY_MANAGER_TEST_MERGED_SRC}/test_sql.cpp
68 ${KEY_MANAGER_TEST_MERGED_SRC}/test_stringify.cpp
69 ${KEY_MANAGER_TEST_MERGED_SRC}/test_ss-crypto.cpp
70 ${KEY_MANAGER_TEST_MERGED_SRC}/test_sw-backend.cpp
71 ${KEY_MANAGER_TEST_MERGED_SRC}/test_xml-parser.cpp
73 # duplicated srcs to test hidden symbols
74 ${KEY_MANAGER_PATH}/client-async/descriptor-set.cpp
75 ${KEY_MANAGER_PATH}/crypto/platform/decider.cpp
76 ${KEY_MANAGER_PATH}/crypto/sw-backend/internals.cpp
77 ${KEY_MANAGER_PATH}/crypto/sw-backend/obj.cpp
78 ${KEY_MANAGER_PATH}/crypto/sw-backend/store.cpp
79 ${KEY_MANAGER_PATH}/dpl/core/src/assert.cpp
80 ${KEY_MANAGER_PATH}/dpl/core/src/colors.cpp
81 ${KEY_MANAGER_PATH}/dpl/core/src/errno_string.cpp
82 ${KEY_MANAGER_PATH}/dpl/db/src/naive_synchronization_object.cpp
83 ${KEY_MANAGER_PATH}/dpl/db/src/sql_connection.cpp
84 ${KEY_MANAGER_PATH}/dpl/log/src/abstract_log_provider.cpp
85 ${KEY_MANAGER_PATH}/dpl/log/src/dlog_log_provider.cpp
86 ${KEY_MANAGER_PATH}/dpl/log/src/journal_log_provider.cpp
87 ${KEY_MANAGER_PATH}/dpl/log/src/log.cpp
88 ${KEY_MANAGER_PATH}/dpl/log/src/old_style_log_provider.cpp
89 ${KEY_MANAGER_PATH}/initial-values/parser.cpp
90 ${KEY_MANAGER_PATH}/initial-values/SWKeyFile.cpp
91 ${KEY_MANAGER_PATH}/initial-values/xml-utils.cpp
92 ${KEY_MANAGER_PATH}/service/crypto-logic.cpp
93 ${KEY_MANAGER_PATH}/service/db-crypto.cpp
94 ${KEY_MANAGER_PATH}/service/for-each-file.cpp
95 ${KEY_MANAGER_PATH}/service/key-provider.cpp
96 ${KEY_MANAGER_PATH}/service/ss-crypto.cpp
99 IF(TZ_BACKEND_ENABLED)
100 SET(TEST_MERGED_SOURCES
101 ${TEST_MERGED_SOURCES}
102 ${KEY_MANAGER_TEST_MERGED_SRC}/test_tz-backend.cpp
104 # duplicated srcs to test hidden symbols
105 ${KEY_MANAGER_PATH}/crypto/tz-backend/obj.cpp
106 ${KEY_MANAGER_PATH}/crypto/tz-backend/store.cpp
107 ${KEY_MANAGER_PATH}/crypto/tz-backend/internals.cpp
108 ${KEY_MANAGER_PATH}/crypto/tz-backend/tz-context.cpp
109 ${KEY_MANAGER_PATH}/crypto/tz-backend/tz-memory.cpp
113 LINK_DIRECTORIES(${KEY_MANAGER_DEP_LIBRARY_DIRS})
115 ADD_EXECUTABLE(${TARGET_TEST_MERGED} ${TEST_MERGED_SOURCES})
118 IF(TZ_BACKEND_ENABLED)
119 SET(TEST_LINK_EXTRA_DEPS
120 ${TEST_LINK_EXTRA_DEPS}
126 TARGET_LINK_LIBRARIES(${TARGET_TEST_MERGED}
127 ${TARGET_KEY_MANAGER_COMMON}
128 ${CMAKE_THREAD_LIBS_INIT}
129 ${KEY_MANAGER_DEP_LIBRARIES}
130 ${TARGET_ENCRYPTION_SCHEME_COMMON}
131 ${TEST_LINK_EXTRA_DEPS}
132 boost_unit_test_framework
136 INSTALL(TARGETS ${TARGET_TEST_MERGED} DESTINATION bin)
139 resources/XML_1_okay.xml
140 resources/XML_1_okay.xsd
141 resources/XML_1_wrong.xml
142 resources/XML_1_wrong.xsd
143 resources/XML_2_structure.xml
144 resources/XML_3_encrypted.xml
145 resources/XML_3_encrypted.xsd
146 resources/XML_4_device_key.xml
147 resources/XML_4_device_key.xsd
148 resources/encryption-scheme.p12
150 resources/db-key-7654
152 resources/testme_ver1.db
153 resources/testme_ver2.db
154 resources/testme_ver3.db
155 DESTINATION ${DB_TEST_DIR}
158 INSTALL(DIRECTORY resources/traverse DESTINATION ${DB_TEST_DIR})
159 INSTALL(DIRECTORY secure-storage-old-data/ DESTINATION ${SS_TEST_DIR})
161 ADD_SUBDIRECTORY(encryption-scheme)