Skip to content

Commit f272ccd

Browse files
committed
run valgrind on mac M1 etc.
1 parent fa5b5e0 commit f272ccd

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM debian:bullseye-slim
2+
3+
RUN apt-get update && apt-get install -y curl valgrind build-essential clang
4+
# Install Rust
5+
ENV RUST_VERSION=stable
6+
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=$RUST_VERSION
7+
# Install cargo-valgrind
8+
RUN /bin/bash -c "source /root/.cargo/env && cargo install cargo-valgrind"

run-docker.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
NAME="valgrind:1.0"
3+
docker image inspect "$NAME" || docker build -t "$NAME" .
4+
docker run -it -v $PWD:/tmp -w /tmp valgrind:1.0
5+
6+
# see https://github.com/jfrimmel/cargo-valgrind/pull/58/commits/1c168f296e0b3daa50279c642dd37aecbd85c5ff#L59
7+
# scan for double frees and leaks
8+
# VALGRINDFLAGS="--leak-check=yes --trace-children=yes" cargo valgrind test

0 commit comments

Comments
 (0)