From 0ec81972eb6166583406806704f8fc4c3d473866 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 24 Mar 2024 21:13:46 +0100 Subject: [PATCH] feat(example/valgrind): Add a script to test the c example with valgrind --- example/main/valgrind_test.sh | 12 ++++++++++++ flake.nix | 1 + 2 files changed, 13 insertions(+) create mode 100755 example/main/valgrind_test.sh diff --git a/example/main/valgrind_test.sh b/example/main/valgrind_test.sh new file mode 100755 index 0000000..355e81f --- /dev/null +++ b/example/main/valgrind_test.sh @@ -0,0 +1,12 @@ +#! /usr/bin/env sh +make +cargo build + +valgrind --leak-check=full \ + --show-leak-kinds=all \ + --show-error-list=yes \ + --track-origins=yes \ + --log-file=./target/valgrind_out.txt \ + ./target/debug/main ./target/c_build/plugin.so + +cat ./target/valgrind_out.txt diff --git a/flake.nix b/flake.nix index c2fe512..8544014 100644 --- a/flake.nix +++ b/flake.nix @@ -170,6 +170,7 @@ rust cargo-edit cargo-expand + valgrind # Used to format the c header files libclang