Skip to content

Commit 8517ef6

Browse files
authored
Add undefined sanitizer to CI (#348)
* Add undefined sanitizer to CI * fixed typo * Minor fix.
1 parent 38d6eae commit 8517ef6

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/ubuntu-undef.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Ubuntu 22.04 (GCC 12 SANITIZED)
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
ubuntu-build:
10+
if: >-
11+
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
12+
! contains(toJSON(github.event.commits.*.message), '[skip github]')
13+
runs-on: ubuntu-22.04
14+
strategy:
15+
matrix:
16+
shared: [ON, OFF]
17+
steps:
18+
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
19+
- name: Setup Ninja
20+
run: sudo apt-get install ninja-build
21+
- name: Prepare
22+
run: cmake -D ADA_SANITIZE_UNDEFINED=ON -DADA_DEVELOPMENT_CHECKS=ON -DBUILD_SHARED_LIBS=${{matrix.shared}} -G Ninja -B build
23+
env:
24+
CXX: g++-12
25+
- name: Build
26+
run: cmake --build build -j=2
27+
- name: Test
28+
run: ctest --output-on-failure --test-dir build

cmake/add-cpp-test.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function(add_cpp_test TEST_NAME)
2020
endif()
2121
if(ADA_SANITIZE_UNDEFINED)
2222
add_compile_options(-fsanitize=undefined -fno-sanitize-recover=all)
23+
add_link_options(-fsanitize=undefined)
2324
endif()
2425
# Add the compile target
2526
if (ARGS_LIBRARY)

0 commit comments

Comments
 (0)