Skip to content

Commit

Permalink
cargo-careful
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim committed May 16, 2023
1 parent beb6fac commit 05018e5
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Sanitizers

on:
pull_request: {}
workflow_dispatch: {}
pull_request:
workflow_dispatch:

jobs:
address:
cargo-careful:
runs-on: ubuntu-latest
container:
image: osgeo/gdal:ubuntu-full-3.6.0
Expand All @@ -30,26 +30,23 @@ jobs:
run: |
rustup toolchain install nightly --profile minimal --component rust-src
rustup override set nightly
cargo install cargo-careful
- name: Get target triple
run: |
echo "TARGET=$(rustc -vV | awk '/^host: / { print $2 }')" >>${GITHUB_ENV}
- name: Run test with address sanitizer
- name: Run tests with careful
env:
RUSTFLAGS: -Z sanitizer=address
RUSTDOCFLAGS: -Z sanitizer=address
# See: https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags
# Note: because we don't build GDAL with sanitizers, we need to turn off
# leak detection, otherwise it'll report memory leak false positives
ASAN_OPTIONS: verbose=1:atexit=1:detect_stack_use_after_return=1:strict_string_checks=1:detect_leaks=0
run: cargo test -Zbuild-std --all --target ${{ env.TARGET }}
run: |
cargo install cargo-careful
cargo careful test -Zbuild-std --all -Zcareful-sanitizer
- name: Run tests with memory sanitizer
env:
RUSTFLAGS: -Z sanitizer=memory
RUSTDOCFLAGS: -Z sanitizer=memory
run: cargo test -Zbuild-std --target ${{ env.TARGET }}
# - name: Run test with address sanitizer
# run: cargo test -Zbuild-std --all --target ${{ env.TARGET }}

- name: Run tests with careful
run: cargo careful test --all -Zcareful-sanitizer

0 comments on commit 05018e5

Please sign in to comment.