diff options
| author | Charles Giessen <charles@lunarg.com> | 2023-06-22 15:08:36 -0600 |
|---|---|---|
| committer | Juan Ramos <114601453+juan-lunarg@users.noreply.github.com> | 2023-06-23 15:59:16 -0600 |
| commit | 247c806c93c720488daa0bc86acd5b6f3a0e14f9 (patch) | |
| tree | a961856eea1ec6fd8478f901caf59e0dbaec4d3f | |
| parent | 52d17b16bb797d3e1669e8829d49278f4af8c48a (diff) | |
| download | usermoji-247c806c93c720488daa0bc86acd5b6f3a0e14f9.tar.xz | |
ci: Enable Address Sanitizer in tests
Turns Address Sanitizer on in the linux and macOS github actions runs.
| -rw-r--r-- | .github/workflows/tools.yml | 4 | ||||
| -rw-r--r-- | tests/CMakeLists.txt | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 33f262ff..f3771964 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -76,7 +76,7 @@ jobs: with: key: ${{ runner.os }}-${{ matrix.config }}-${{ matrix.cc }}-${{matrix.cube_wsi}} - name: Configure - run: cmake -S. -B build -G "Ninja" -DCMAKE_BUILD_TYPE=${{matrix.config}} -DCUBE_WSI_SELECTION=${{matrix.cube_wsi}} -D UPDATE_DEPS=ON -D INSTALL_ICD=ON -D BUILD_TESTS=ON + run: cmake -S. -B build -G "Ninja" -DCMAKE_BUILD_TYPE=${{matrix.config}} -DCUBE_WSI_SELECTION=${{matrix.cube_wsi}} -D UPDATE_DEPS=ON -D INSTALL_ICD=ON -D BUILD_TESTS=ON -D ENABLE_ADDRESS_SANITIZER=ON env: CC: ${{matrix.cc}} CXX: ${{matrix.cxx}} @@ -146,7 +146,7 @@ jobs: run: echo "/usr/lib/ccache:/usr/local/opt/ccache/libexec" >> $GITHUB_PATH - name: Configure - run: cmake -S. -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -D UPDATE_DEPS=ON -D INSTALL_ICD=ON -D BUILD_TESTS=ON + run: cmake -S. -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -D UPDATE_DEPS=ON -D INSTALL_ICD=ON -D BUILD_TESTS=ON -D ENABLE_ADDRESS_SANITIZER=ON env: MACOSX_DEPLOYMENT_TARGET: 10.15 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 048f0937..481c68dd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -44,5 +44,10 @@ target_include_directories(vulkan_tools_tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR target_link_libraries(vulkan_tools_tests GTest::gtest Vulkan::Vulkan) add_dependencies(vulkan_tools_tests generate_binary_locations) +if (ENABLE_ADDRESS_SANITIZER) + target_compile_options(vulkan_tools_tests PUBLIC -fsanitize=address) + target_link_options(vulkan_tools_tests PUBLIC -fsanitize=address) +endif () + include(GoogleTest) gtest_discover_tests(vulkan_tools_tests DISCOVERY_TIMEOUT 100) |
