From 40829b849ae30d3a9de330d4d66af74f547fbaf1 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 6 Jun 2020 01:51:39 +0430 Subject: [PATCH] Meta: Run Crypto tests in CI We skip the tests that are not self-contained (TLS) to avoid adding extra variables to the tests. --- Meta/Lagom/CMakeLists.txt | 5 +++++ Userland/test-crypto.cpp | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 4f9b7bd04a..ac6ff70b19 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -77,6 +77,11 @@ if (BUILD_LAGOM) set_target_properties(test-crypto_lagom PROPERTIES OUTPUT_NAME test-crypto) target_link_libraries(test-crypto_lagom Lagom) target_link_libraries(test-crypto_lagom stdc++) + add_test( + NAME Crypto + COMMAND test-crypto_lagom test -tc + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) add_executable(disasm_lagom ../../Userland/disasm.cpp) set_target_properties(disasm_lagom PROPERTIES OUTPUT_NAME disasm) diff --git a/Userland/test-crypto.cpp b/Userland/test-crypto.cpp index c31c3cc12a..bc1532191e 100644 --- a/Userland/test-crypto.cpp +++ b/Userland/test-crypto.cpp @@ -51,6 +51,7 @@ static bool binary = false; static bool interactive = false; static bool run_tests = false; static int port = 443; +static bool in_ci = false; static struct timeval start_time { 0, 0 @@ -283,6 +284,7 @@ auto main(int argc, char** argv) -> int parser.add_option(suite, "Set the suite used", "suite-name", 'n', "suite name"); parser.add_option(server, "Set the server to talk to (only for `tls')", "server-address", 's', "server-address"); parser.add_option(port, "Set the port to talk to (only for `tls')", "port", 'p', "port"); + parser.add_option(in_ci, "CI Test mode", "ci-mode", 'c'); parser.parse(argc, argv); StringView mode_sv { mode }; @@ -381,7 +383,10 @@ auto main(int argc, char** argv) -> int rsa_tests(); - tls_tests(); + if (!in_ci) { + // Do not run these in CI to avoid tests with variables outside our control. + tls_tests(); + } bigint_tests();