From 43c30ec0dfc3fc7bb8b6258c5c3d483938cc9839 Mon Sep 17 00:00:00 2001 From: Deye Date: Thu, 27 Jun 2024 15:50:36 -0700 Subject: [PATCH] added build testing flag --- tool-openssl/CMakeLists.txt | 28 +++++++++++++--------------- util/all_tests.json | 5 +++++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tool-openssl/CMakeLists.txt b/tool-openssl/CMakeLists.txt index 59b6ce5e01..aacaaf2834 100644 --- a/tool-openssl/CMakeLists.txt +++ b/tool-openssl/CMakeLists.txt @@ -39,18 +39,16 @@ if(MSVC AND CMAKE_BUILD_TYPE_LOWER MATCHES "relwithdebinfo" AND FIPS) install (FILES $/openssl.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - -add_executable( - x509_test - - x509_test.cc - ../tool/args.cc - ../tool/file.cc - x509.cc -) - -target_link_libraries(x509_test boringssl_gtest_main ssl crypto) -enable_testing() -add_test(NAME X509Test COMMAND x509_test) - - +if(BUILD_TESTING) + add_executable( + x509_test + + x509_test.cc + ../tool/args.cc + ../tool/file.cc + x509.cc + ) + + target_link_libraries(x509_test boringssl_gtest_main ssl crypto) + add_dependencies(all_tests x509_test) +endif() diff --git a/util/all_tests.json b/util/all_tests.json index 464414ad8d..7fa3c333dd 100644 --- a/util/all_tests.json +++ b/util/all_tests.json @@ -125,5 +125,10 @@ "cmd": [ "crypto/rwlock_static_init" ] + }, + { + "cmd": [ + "tool-openssl/x509_test" + ] } ]