aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-03-18 22:43:46 +1000
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-03-23 14:43:15 +0000
commit3ae23976862fa9036ab52e47c8a22025f5d76ca0 (patch)
tree32196be50aa78eb420ef15854d2b373dee526021 /CMakeLists.txt
parent231510cf506711eae6f7f06be9626bc7e44982b4 (diff)
downloadboringssl-3ae23976862fa9036ab52e47c8a22025f5d76ca0.zip
boringssl-3ae23976862fa9036ab52e47c8a22025f5d76ca0.tar.gz
boringssl-3ae23976862fa9036ab52e47c8a22025f5d76ca0.tar.bz2
Rework the test data story
We originally embedded test data because of deficiencies in Android's build. Android had no way to specify test data with tests. That has since been resolved, and the embedding mechanism has gotten unwieldy. This unifies pki_test and crypto_test's test data story, and does so in a way that all tests can participate in. (We can now use FileTest in decrepit_test.) Update-Note: This will require some tweaks to downstream builds. We no longer emit an (unwieldy) crypto_test_data.cc file. Instead, tests will expect test data be available at the current working directory. This can be overridden with the BORINGSSL_TEST_DATA_ROOT environment variable. Callers with more complex needs can build with BORINGSSL_CUSTOM_GET_TEST_DATA and then link in an alternate implementation of this function. On the off chance some project needs it, I've kept the embed_test_data.go script around for now, but I expect we can delete it in the future. Fixed: 681 Change-Id: If181ce043e1eea3148838f1bb4db9ee4bfda0d08 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/67295 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 1 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35fb567..1cff48f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -490,26 +490,6 @@ target_include_directories(
# themselves as dependencies next to the target definition.
add_custom_target(all_tests)
-# On Windows, CRYPTO_TEST_DATA is too long to fit in command-line limits.
-# TODO(davidben): CMake 3.12 has a list(JOIN) command. Use that when we've
-# updated the minimum version.
-set(EMBED_TEST_DATA_ARGS "")
-foreach(arg ${CRYPTO_TEST_DATA})
- set(EMBED_TEST_DATA_ARGS "${EMBED_TEST_DATA_ARGS}${arg}\n")
-endforeach()
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/embed_test_data_args.txt"
- "${EMBED_TEST_DATA_ARGS}")
-
-add_custom_command(
- OUTPUT crypto_test_data.cc
- COMMAND ${GO_EXECUTABLE} run util/embed_test_data.go -file-list
- "${CMAKE_CURRENT_BINARY_DIR}/embed_test_data_args.txt" >
- "${CMAKE_CURRENT_BINARY_DIR}/crypto_test_data.cc"
- DEPENDS util/embed_test_data.go ${CRYPTO_TEST_DATA}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
-add_library(crypto_test_data OBJECT crypto_test_data.cc)
-
add_subdirectory(crypto)
add_subdirectory(ssl/test)
add_subdirectory(util/fipstools)
@@ -550,7 +530,7 @@ add_executable(urandom_test ${URANDOM_TEST_SOURCES})
target_link_libraries(urandom_test test_support_lib boringssl_gtest crypto)
add_dependencies(all_tests urandom_test)
-add_executable(crypto_test ${CRYPTO_TEST_SOURCES} $<TARGET_OBJECTS:crypto_test_data>)
+add_executable(crypto_test ${CRYPTO_TEST_SOURCES})
target_link_libraries(crypto_test test_support_lib boringssl_gtest crypto)
add_dependencies(all_tests crypto_test)