diff --git a/Dockerfile.build b/Dockerfile.build index f48a47f..5c989c1 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -30,3 +30,13 @@ RUN cargo clippy -- -D warnings RUN cargo build -r RUN cargo test + +# Install rustup and nightly toolchain for ASAN tests +RUN curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly && \ + source "${HOME}"/.cargo/env && \ + rustup component add rust-src --toolchain nightly + +# Run ASAN tests +RUN source "${HOME}"/.cargo/env && \ + TARGET=$(rustc --version --verbose | grep host | cut -d" " -f2) && \ + RUSTFLAGS="-Z sanitizer=address" cargo +nightly test -Z build-std --target "$TARGET"