From 7cace08302d40bbed5bd4d3b12437b6d299142d9 Mon Sep 17 00:00:00 2001 From: Imdad Sardharwalla <imdad.sardharwalla@autodesk.com> Date: Tue, 8 Jun 2021 14:47:26 +0100 Subject: [PATCH] REFORM-1090 Create a BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS CMake option (#53) --- CMakeLists.txt | 6 ++++++ Test/TestReport.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60d0395..7b1dd49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,12 @@ set(output_lib "Base") add_library(${output_lib} STATIC) +# Add option to enable extra parsing of the CTest log +option(BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS "Declare that CTest test names are the same as the test output paths to enable extra CTest log parsing." OFF) +if (BASE_TEST_CTEST_NAMES_ARE_OUTPUT_PATHS) + target_compile_definitions(${output_lib} PRIVATE TEST_REPORT_CTEST_NAMES_ARE_OUTPUT_PATHS) +endif() + function(base_add_subdir subdir) # initialize these variables since ASM is printing warnings otherwise set(my_headers "") diff --git a/Test/TestReport.cc b/Test/TestReport.cc index b33e9a6..d68bfb6 100644 --- a/Test/TestReport.cc +++ b/Test/TestReport.cc @@ -281,7 +281,7 @@ void TestList::parse_ctest_log(const fs::path& _ctest_log_path) << "WARNING: There are " << ctest_tests_nmbr << " tests listed in the CTest log, but checksums were recorded " "for only " - << tests_.size() << " tests." << std::endl + << tests_.size() << " test(s)." << std::endl << std::endl; } #endif // TEST_REPORT_CTEST_NAMES_ARE_OUTPUT_PATHS -- GitLab