| 1 |
# Copyright (c) 2013, 2026, Oracle and/or its affiliates. |
| 2 |
# |
| 3 |
# This program is free software; you can redistribute it and/or modify |
| 4 |
# it under the terms of the GNU General Public License, version 2.0, |
| 5 |
# as published by the Free Software Foundation. |
| 6 |
# |
| 7 |
# This program is designed to work with certain software (including |
| 8 |
# but not limited to OpenSSL) that is licensed under separate terms, |
| 9 |
# as designated in a particular file or component or in included license |
| 10 |
# documentation. The authors of MySQL hereby grant you an additional |
| 11 |
# permission to link the program and your derivative works with the |
| 12 |
# separately licensed software that they have either included with |
| 13 |
# the program or referenced in the documentation. |
| 14 |
# |
| 15 |
# This program is distributed in the hope that it will be useful, |
| 16 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
# GNU General Public License, version 2.0, for more details. |
| 19 |
# |
| 20 |
# You should have received a copy of the GNU General Public License |
| 21 |
# along with this program; if not, write to the Free Software |
| 22 |
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 23 |
|
| 24 |
SET(TESTS |
| 25 |
keyring-api |
| 26 |
keys_container |
| 27 |
buffered_file_io |
| 28 |
converter |
| 29 |
file_io |
| 30 |
) |
| 31 |
|
| 32 |
ADD_DEFINITIONS(-DLOG_COMPONENT_TAG="keyring_file_tests") |
| 33 |
|
| 34 |
SET(ALL_KEYRING_TESTS) |
| 35 |
FOREACH(test ${TESTS}) |
| 36 |
LIST(APPEND ALL_KEYRING_TESTS ${test}-t.cc) |
| 37 |
ENDFOREACH() |
| 38 |
|
| 39 |
|
| 40 |
SET(SRC_FILES) |
| 41 |
LIST(APPEND SRC_FILES |
| 42 |
${CMAKE_SOURCE_DIR}/plugin/keyring/common/keyring_key.cc |
| 43 |
${CMAKE_SOURCE_DIR}/plugin/keyring/common/keys_container.cc |
| 44 |
${CMAKE_SOURCE_DIR}/plugin/keyring/common/keys_iterator.cc |
| 45 |
${CMAKE_SOURCE_DIR}/plugin/keyring/buffered_file_io.cc |
| 46 |
${CMAKE_SOURCE_DIR}/plugin/keyring/converter.cc |
| 47 |
${CMAKE_SOURCE_DIR}/plugin/keyring/buffer.cc |
| 48 |
${CMAKE_SOURCE_DIR}/plugin/keyring/hash_to_buffer_serializer.cc |
| 49 |
${CMAKE_SOURCE_DIR}/plugin/keyring/digest.cc |
| 50 |
${CMAKE_SOURCE_DIR}/plugin/keyring/file_io.cc |
| 51 |
${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker.cc |
| 52 |
${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker_factory.cc |
| 53 |
${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker_ver_1_0.cc |
| 54 |
${CMAKE_SOURCE_DIR}/plugin/keyring/checker/checker_ver_2_0.cc |
| 55 |
${CMAKE_SOURCE_DIR}/unittest/gunit/keyring/buffered_file_io_10.cc |
| 56 |
${CMAKE_SOURCE_DIR}/unittest/gunit/keyring/psi_memory_key.cc |
| 57 |
) |
| 58 |
|
| 59 |
IF(WIN32) |
| 60 |
LIST(APPEND SRC_FILES ../../../sql/nt_servc.cc) |
| 61 |
ENDIF() |
| 62 |
|
| 63 |
ADD_STATIC_LIBRARY(keyring_test ${SRC_FILES} LINK_LIBRARIES ext::zlib) |
| 64 |
ADD_DEPENDENCIES(keyring_test GenError) |
| 65 |
|
| 66 |
MYSQL_ADD_EXECUTABLE(merge_keyring_file_tests-t |
| 67 |
${ALL_KEYRING_TESTS} |
| 68 |
ENABLE_EXPORTS |
| 69 |
ADD_TEST merge_keyring_file_tests) |
| 70 |
|
| 71 |
TARGET_LINK_LIBRARIES(merge_keyring_file_tests-t |
| 72 |
keyring_test |
| 73 |
gunit_large |
| 74 |
server_unittest_library |
| 75 |
) |
| 76 |
|
| 77 |
ADD_DEPENDENCIES(merge_keyring_file_tests-t GenError) |
| 78 |
IF(MY_COMPILER_IS_GNU) |
| 79 |
MY_CHECK_CXX_COMPILER_WARNING("error=maybe-uninitialized" HAS_WARN_FLAG) |
| 80 |
IF(HAS_WARN_FLAG) |
| 81 |
MY_TARGET_LINK_OPTIONS(merge_keyring_file_tests-t "${HAS_WARN_FLAG}") |
| 82 |
ENDIF() |
| 83 |
ENDIF() |
| 84 |
|
| 85 |
FOREACH(test ${TESTS}) |
| 86 |
MYSQL_ADD_EXECUTABLE(${test}-t ${test}-t.cc |
| 87 |
ENABLE_EXPORTS SKIP_INSTALL EXCLUDE_FROM_ALL) |
| 88 |
|
| 89 |
TARGET_LINK_LIBRARIES(${test}-t |
| 90 |
keyring_test |
| 91 |
gunit_large |
| 92 |
server_unittest_library |
| 93 |
) |
| 94 |
ENDFOREACH() |
| 95 |
|