aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2023-06-30 14:10:42 -0400
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-07-05 19:25:42 +0000
commit197b57154f3cc3c0c32b251c3c233caa0c0a0d94 (patch)
tree34b6bd43610190eadbd3f9518c27ccffeb02bff2 /CMakeLists.txt
parent8e8f87ea945b944dc9ecbeff1a955e73d1f67209 (diff)
downloadboringssl-197b57154f3cc3c0c32b251c3c233caa0c0a0d94.zip
boringssl-197b57154f3cc3c0c32b251c3c233caa0c0a0d94.tar.gz
boringssl-197b57154f3cc3c0c32b251c3c233caa0c0a0d94.tar.bz2
Use sources.cmake for test binaries
CMake and the generate builds now broadly share a source of truth for the test files. Update-Note: In the standalone CMake build, build/crypto/crypto_test is now build/crypto_test, etc. For now, the build still copies the outputs to the subdirectories (it's cheap and avoids some workflow turbulence), but I'm thinking we keep that for six months or so and then remove it. Bug: 542 Change-Id: I8f97e1fcedea1375d48567dfd2da01a6e66ec4e8 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61286 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: Bob Beck <bbe@google.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63e65ef..efb5cda 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -520,6 +520,26 @@ add_subdirectory(util/fipstools)
add_subdirectory(util/fipstools/acvp/modulewrapper)
add_subdirectory(decrepit)
+# urandom_test is a separate binary because it needs to be able to observe the
+# PRNG initialisation, which means that it can't have other tests running before
+# it does.
+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>)
+target_link_libraries(crypto_test test_support_lib boringssl_gtest_main crypto)
+add_dependencies(all_tests crypto_test)
+
+add_executable(ssl_test ${SSL_TEST_SOURCES})
+target_link_libraries(ssl_test test_support_lib boringssl_gtest_main ssl crypto)
+add_dependencies(all_tests ssl_test)
+
+add_executable(decrepit_test ${DECREPIT_TEST_SOURCES})
+target_link_libraries(decrepit_test test_support_lib boringssl_gtest_main
+ decrepit crypto)
+add_dependencies(all_tests decrepit_test)
+
if(APPLE)
set(PKI_CXX_FLAGS "-fno-aligned-new")
endif()
@@ -541,6 +561,13 @@ set_target_properties(
CXX_STANDARD_REQUIRED YES
COMPILE_FLAGS "${PKI_CXX_FLAGS}")
+# Historically, targets were built in subdirectories. For compatibility with
+# existing tools, we, for now, copy the targets into the subdirectories. This
+# will be removed sometime in 2024.
+copy_post_build(crypto crypto_test urandom_test)
+copy_post_build(ssl ssl_test)
+copy_post_build(decrepit decrepit_test)
+
if(FUZZ)
if(LIBFUZZER_FROM_DEPS)
file(GLOB LIBFUZZER_SOURCES "util/bot/libFuzzer/*.cpp")