diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3a11d6f..cf5ad712 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ jobs: compiler: [g++-10, clang++-14] cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug, Release] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: dependencies @@ -25,6 +26,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{matrix.target}} \ -DCMAKE_CXX_COMPILER=${{matrix.compiler}} \ -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" \ + -DLIBASSERT_BUILD_SHARED=${{matrix.shared}} \ -DLIBASSERT_WERROR_BUILD=On make -j build-macos: @@ -33,9 +35,9 @@ jobs: fail-fast: false matrix: compiler: [g++-12, clang++] - c_compiler: [g++-12, clang++] cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug, Release] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: build @@ -46,6 +48,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{matrix.target}} \ -DCMAKE_CXX_COMPILER=${{matrix.compiler}} \ -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" \ + -DLIBASSERT_BUILD_SHARED=${{matrix.shared}} \ -DLIBASSERT_WERROR_BUILD=On make -j build-windows: @@ -56,6 +59,7 @@ jobs: compiler: [cl, clang++] cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug, Release] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt @@ -68,6 +72,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{matrix.target}} ` -DCMAKE_CXX_COMPILER=${{matrix.compiler}} ` -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" ` + -DLIBASSERT_BUILD_SHARED=${{matrix.shared}} ` -DLIBASSERT_WERROR_BUILD=On msbuild .\libassert.sln build-mingw: @@ -78,6 +83,7 @@ jobs: compiler: [g++] cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug, Release] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt @@ -90,6 +96,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{matrix.target}} ` -DCMAKE_CXX_COMPILER=${{matrix.compiler}} ` -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" ` + -DLIBASSERT_BUILD_SHARED=${{matrix.shared}} ` -DLIBASSERT_WERROR_BUILD=On ` "-GUnix Makefiles" make -j diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c684ac30..7269c909 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,9 @@ jobs: fail-fast: false matrix: compiler: [g++-10, clang++-14] + cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: dependencies @@ -28,6 +30,9 @@ jobs: cmake .. \ -DCMAKE_BUILD_TYPE=${{matrix.target}} \ -DCMAKE_CXX_COMPILER=${{matrix.compiler}} \ + -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" \ + -DLIBASSERT_BUILD_SHARED=${{matrix.shared}} \ + -DCPPTRACE_BUILD_SHARED=ON \ -DLIBASSERT_BUILD_TESTING=On \ -DLIBASSERT_WERROR_BUILD=On make -j @@ -68,15 +73,9 @@ jobs: fail-fast: false matrix: compiler: [g++-12, clang++] - c_compiler: [gcc-12, clang] + cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug] - exclude: # TODO: Ugly hack - - compiler: g++-12 - c_compiler: clang - - compiler: clang++ - c_compiler: gcc-12 - - compiler: clang++ # Disabled due to #15 TODO TODO TODO - target: Debug + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: dependencies @@ -89,7 +88,8 @@ jobs: cmake .. \ -DCMAKE_BUILD_TYPE=${{matrix.target}} \ -DCMAKE_CXX_COMPILER=${{matrix.compiler}} \ - -DCMAKE_C_COMPILER=${{matrix.c_compiler}} \ + -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" \ + -DCPPTRACE_BUILD_SHARED=ON \ -DLIBASSERT_BUILD_TESTING=On \ -DLIBASSERT_WERROR_BUILD=On make -j @@ -102,8 +102,10 @@ jobs: strategy: fail-fast: false matrix: - compiler: [cl] # turned off clang for now + compiler: [cl, clang++] + cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt @@ -112,12 +114,15 @@ jobs: run: | pip install icdiff - name: build msvc - if: ${{ matrix.compiler == 'cl' }} + # if: ${{ matrix.compiler == 'cl' }} run: | mkdir -p build cd build cmake .. ` -DCMAKE_BUILD_TYPE=${{matrix.target}} ` + -DCMAKE_CXX_COMPILER=${{matrix.compiler}} ` + -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" ` + -DCPPTRACE_BUILD_SHARED=ON ` -DLIBASSERT_BUILD_TESTING=On ` -DLIBASSERT_WERROR_BUILD=On msbuild .\libassert.sln @@ -143,7 +148,9 @@ jobs: fail-fast: false matrix: compiler: [g++] + cxx_version: [ cxx_std_17, cxx_std_20 ] target: [Debug] + shared: [ON, OFF] steps: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt @@ -158,6 +165,8 @@ jobs: cmake .. ` -DCMAKE_BUILD_TYPE=${{matrix.target}} ` -DCMAKE_CXX_COMPILER=${{matrix.compiler}} ` + -DLIBASSERT_DESIRED_CXX_STANDARD="${{matrix.cxx_version}}" ` + -DCPPTRACE_BUILD_SHARED=ON ` -DLIBASSERT_BUILD_TESTING=On ` -DLIBASSERT_USE_CI_WRAPPER=On ` "-GUnix Makefiles" ` diff --git a/tests/integration/expected/clang.macos.txt b/tests/integration/expected/clang.macos.txt new file mode 100644 index 00000000..b6f7c61e --- /dev/null +++ b/tests/integration/expected/clang.macos.txt @@ -0,0 +1,107 @@ +===================== [simple recursion] ===================== +Debug Assertion failed at integration.cpp:501: void rec(int): + debug_assert(false); + +Stack trace: +# 1 rec(int) + at integration.cpp:501 +# 2 rec(int) + at integration.cpp:502 +| | +| 8 layers of recursion were folded | +| | +#11 rec(int) + at integration.cpp:502 +#12 test_class::something_else() + at integration.cpp:2600 +#13 void test_class::something(std::__1::pair) + at integration.cpp:1004 +#14 main + at integration.cpp:402 + + +===================== [other recursion] ===================== +Debug Assertion failed at integration.cpp:508: void recursive_a(int): + debug_assert(false); + +Stack trace: +# 1 recursive_a(int) + at integration.cpp:508 +# 2 recursive_b(int) + at integration.cpp:514 +# 3 recursive_a(int) + at integration.cpp:509 +# 4 recursive_b(int) + at integration.cpp:514 +# 5 recursive_a(int) + at integration.cpp:509 +# 6 recursive_b(int) + at integration.cpp:514 +# 7 recursive_a(int) + at integration.cpp:509 +# 8 recursive_b(int) + at integration.cpp:514 +# 9 recursive_a(int) + at integration.cpp:509 +#10 recursive_b(int) + at integration.cpp:514 +#11 recursive_a(int) + at integration.cpp:509 +#12 test_class::something_else() + at integration.cpp:2700 +#13 void test_class::something(std::__1::pair) + at integration.cpp:1004 +#14 main + at integration.cpp:402 + + +===================== [Path differentiation] ===================== +Debug Assertion failed at x/a.cpp:5: void test_path_differentiation_2(): + debug_assert(false); + +Stack trace: +# 1 test_path_differentiation_2() + at x/a.cpp:5 +# 2 test_path_differentiation() + at integration/a.cpp:7 +# 3 test_class::something_else() + at integration.cpp:2800 +# 4 void test_class::something(std::__1::pair) + at integration.cpp:1004 +# 5 main + at integration.cpp:402 + + +===================== [Type cleaning] ===================== +Debug Assertion failed at integration.cpp:3305: void test_class::test_pretty_function_cleaning(const std::map> &) [T = int]: + debug_assert(map == other); + Where: + map => std::map>: [["bar", ["b1", "b3", "b5"]], ["foo", ["f1", "f3", "f5"]]] + other => std::map>: [] + +Stack trace: +# 1 test_class::test_pretty_function_cleaning(std::__1::map, std::__1::less> const&) + at integration.cpp:3305 +# 2 test_class::something_else() + at integration.cpp:3201 +# 3 void test_class::something(std::__1::pair) + at integration.cpp:1004 +# 4 main + at integration.cpp:402 + + +===================== [Complex type resolution] ===================== +Debug Assertion failed at integration.cpp:3602: void test_class::test_complex_typing(const volatile std::vector *const &, int *, const char (&)[4], decltype(&complex_typing::S::foo), int complex_typing::S::*) [T = int]: + debug_assert(false); + +Stack trace: +# 1 test_class::test_complex_typing(std::__1::vector const volatile* const&, int*, char const (&) [4], void (complex_typing::S::*)(int, std::string, void***, void* (*)(int), void (* (*)(int))(), void (* (* (*)(int)) [5])()), int complex_typing::S::*) + at integration.cpp:3602 +# 2 test_class::something_else() + at integration.cpp:3502 +# 3 void test_class::something(std::__1::pair) + at integration.cpp:1004 +# 4 main + at integration.cpp:402 + + diff --git a/tests/run-tests.py b/tests/run-tests.py index a221c8b3..a4e49cf9 100644 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -83,7 +83,7 @@ def main(): compiler_id = sys.argv[3].lower() if compiler_id.startswith("gcc") or compiler_id.startswith("g++") or compiler_id.startswith("gnu"): target.append("gnu") - elif compiler_id.startswith("clang"): + elif "clang" in compiler_id: target.append("clang") elif compiler_id.startswith("cl") or compiler_id.startswith("msvc"): target.append("msvc")