From c92eeca2c5e5236fcf02da2a7455e994a1085823 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:16:18 -0500 Subject: [PATCH] Build unit tests in CI --- ci/test-all-configs.py | 8 ++++---- cmake/OptionVariables.cmake | 4 ++-- test/CMakeLists.txt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ci/test-all-configs.py b/ci/test-all-configs.py index af5de80..70021f8 100644 --- a/ci/test-all-configs.py +++ b/ci/test-all-configs.py @@ -177,7 +177,7 @@ def build(matrix): f"-D{matrix['demangle']}=On", "-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h", "-DCPPTRACE_BUILD_TESTING=On", - "-DCPPTRACE_IS_GH_ACTIONS=On", + "-DCPPTRACE_SKIP_UNIT=On", f"-DBUILD_SHARED_LIBS={matrix['shared']}" ] if matrix['symbols'] == "CPPTRACE_GET_SYMBOLS_WITH_LIBDL": @@ -200,7 +200,7 @@ def build(matrix): f"-D{matrix['symbols']}=On", f"-D{matrix['demangle']}=On", "-DCPPTRACE_BUILD_TESTING=On", - "-DCPPTRACE_IS_GH_ACTIONS=On", + "-DCPPTRACE_SKIP_UNIT=On", f"-DBUILD_SHARED_LIBS={matrix['shared']}" ] if matrix["compiler"] == "g++": @@ -227,7 +227,7 @@ def build_full_or_auto(matrix): f"-DCPPTRACE_WERROR_BUILD=On", f"-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h", "-DCPPTRACE_BUILD_TESTING=On", - "-DCPPTRACE_IS_GH_ACTIONS=On", + "-DCPPTRACE_SKIP_UNIT=On", f"-DBUILD_SHARED_LIBS={matrix['shared']}" ] if matrix["config"] != "": @@ -247,7 +247,7 @@ def build_full_or_auto(matrix): f"-DCPPTRACE_USE_EXTERNAL_ZSTD=On", f"-DCPPTRACE_WERROR_BUILD=On", "-DCPPTRACE_BUILD_TESTING=On", - "-DCPPTRACE_IS_GH_ACTIONS=On", + "-DCPPTRACE_SKIP_UNIT=On", f"-DBUILD_SHARED_LIBS={matrix['shared']}" ] if matrix["config"] != "": diff --git a/cmake/OptionVariables.cmake b/cmake/OptionVariables.cmake index 6d18d02..716df4a 100644 --- a/cmake/OptionVariables.cmake +++ b/cmake/OptionVariables.cmake @@ -166,7 +166,7 @@ option(CPPTRACE_VCPKG "" OFF) option(CPPTRACE_SANITIZER_BUILD "" OFF) option(CPPTRACE_WERROR_BUILD "" OFF) option(CPPTRACE_POSITION_INDEPENDENT_CODE "" ON) -option(CPPTRACE_IS_GH_ACTIONS "" OFF) +option(CPPTRACE_SKIP_UNIT "" OFF) option(CPPTRACE_USE_EXTERNAL_GTEST "" OFF) mark_as_advanced( @@ -177,6 +177,6 @@ mark_as_advanced( CPPTRACE_WERROR_BUILD CPPTRACE_CONAN CPPTRACE_VCPKG - CPPTRACE_IS_GH_ACTIONS + CPPTRACE_SKIP_UNIT CPPTRACE_USE_EXTERNAL_GTEST ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e1cf272..1fc6c66 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ if(UNIX) endif() # primarily a workaround for github actions issue https://github.com/actions/runner-images/issues/8659 -if(NOT CPPTRACE_IS_GH_ACTIONS) +if(NOT CPPTRACE_SKIP_UNIT) if(CPPTRACE_USE_EXTERNAL_GTEST) find_package(GTest) else() @@ -60,6 +60,6 @@ if(NOT CPPTRACE_IS_GH_ACTIONS) ) target_compile_features(unittest PRIVATE cxx_std_20) target_link_libraries(unittest PRIVATE ${target_name} GTest::gtest_main GTest::gmock_main) - target_compile_options(unittest PRIVATE ${warning_options} -Wno-pedantic) + target_compile_options(unittest PRIVATE ${warning_options} $<$>:-Wno-pedantic -Wno-attributes>) add_test(NAME unittest COMMAND unittest) endif()