From d4031fc53bf3dbfbede536d903361217540b7bae Mon Sep 17 00:00:00 2001 From: hhenry01 Date: Wed, 6 Mar 2024 20:18:39 -0800 Subject: [PATCH] temp commit to debug CI --- functions.cmake | 1 + .../test/test_local_transceiver.cpp | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/functions.cmake b/functions.cmake index 92d0408..ef704fb 100644 --- a/functions.cmake +++ b/functions.cmake @@ -50,5 +50,6 @@ function(make_unit_test module srcs link_libs inc_dirs compile_defs) add_dependencies(${test_module} ${AUTOGEN_TARGETS}) # Make the unit test runnable with CTest (invoked via test.sh) add_test(NAME ${test_module} COMMAND ${test_module}) + set_tests_properties(${test_module} PROPERTIES TIMEOUT 60) # 1 minute per test timeout endif() endfunction() diff --git a/projects/local_transceiver/test/test_local_transceiver.cpp b/projects/local_transceiver/test/test_local_transceiver.cpp index c3b0002..cfa5c91 100644 --- a/projects/local_transceiver/test/test_local_transceiver.cpp +++ b/projects/local_transceiver/test/test_local_transceiver.cpp @@ -36,15 +36,25 @@ class TestLocalTransceiver : public ::testing::Test protected: static void SetUpTestSuite() { http_echo_server_proc_ = bp::child(RUN_HTTP_ECHO_SERVER_CMD); } - static void TearDownTestSuite() { http_echo_server_proc_.terminate(); } + static void TearDownTestSuite() + { + std::error_code e; + http_echo_server_proc_.terminate(e); + if (e) { + throw std::runtime_error("Failed to terminate HTTP Echo Server! " + e.message()); + } + } TestLocalTransceiver() { try { lcl_trns_ = new LocalTransceiver(LOCAL_TRANSCEIVER_TEST_PORT, SATELLITE_BAUD_RATE); - } catch (boost::system::system_error & /**/) { - std::cerr << "Failed to create Local Transceiver for tests, is only one instance of: \"" - << RUN_VIRTUAL_IRIDIUM_SCRIPT_PATH << "\" running?" << std::endl; + } catch (boost::system::system_error & e) { + std::stringstream ss; + ss << "Failed to create Local Transceiver for tests, is only one instance of: \"" + << RUN_VIRTUAL_IRIDIUM_SCRIPT_PATH << "\" running?" << std::endl; + ss << e.what() << std::endl; + throw std::runtime_error(ss.str()); } } ~TestLocalTransceiver() override