Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with ASAN #647

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,24 @@ jobs:
run: |
cd build
./test/run_tests "~[quality]"
build-clang13-asan:
runs-on: ubuntu-latest
name: Clang 13 + ASAN

steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Build mockturtle with ASAN
run: |
mkdir build
cd build
cmake -DCMAKE_CXX_COMPILER=clang++-13 -DENABLE_ASAN=ON -DMOCKTURTLE_TEST=ON ..
make run_tests
- name: Run tests with ASAN
run: |
cd build
./test/run_tests "~[quality]"
compile-gcc9:
runs-on: ubuntu-latest
name: Compile everything (GCC 9)
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" OFF)
option(ENABLE_MATPLOTLIB "Enable matplotlib library in experiments" OFF)
option(ENABLE_NAUTY "Enable the Nauty library for percy" OFF)
option(ENABLE_ABC "Enable linking ABC as a static library" OFF)
option(ENABLE_ASAN, "Enable ASAN sanitizer" OFF)

if(UNIX)
# show quite some warnings (but remove some intentionally)
Expand All @@ -28,6 +29,10 @@ if(UNIX)
if (ENABLE_COVERAGE)
add_compile_options(-O0 -g --coverage -fprofile-arcs -ftest-coverage)
endif()
if (ENABLE_ASAN)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -DADDRESS_SANITIZER)
add_link_options(-fsanitize=address)
endif()
endif()
if(MSVC)
add_compile_options(/EHsc /bigobj)
Expand Down
Loading