diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-03-31 16:29:47 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-03-31 23:59:52 +0200 |
commit | 392a8dd604e7f7cac385f51fe083a78c8a7f9904 (patch) | |
tree | 60b0c41c0e0b535a593f86fccad22c69ff58991f /templates/c/scripts | |
parent | chore(version): v0.2.0 (diff) | |
download | flake-templates-392a8dd604e7f7cac385f51fe083a78c8a7f9904.tar.gz flake-templates-392a8dd604e7f7cac385f51fe083a78c8a7f9904.zip |
feat(c): Update to be in line with the my SOTA
Diffstat (limited to '')
l--------- | templates/c/scripts/renew_copyright_header.sh | 1 | ||||
-rwxr-xr-x | templates/c/scripts/valgrind_test.sh | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/templates/c/scripts/renew_copyright_header.sh b/templates/c/scripts/renew_copyright_header.sh new file mode 120000 index 0000000..f286da9 --- /dev/null +++ b/templates/c/scripts/renew_copyright_header.sh @@ -0,0 +1 @@ +../../../common/renew_copyright_header.sh \ No newline at end of file diff --git a/templates/c/scripts/valgrind_test.sh b/templates/c/scripts/valgrind_test.sh new file mode 100755 index 0000000..4d0d964 --- /dev/null +++ b/templates/c/scripts/valgrind_test.sh @@ -0,0 +1,29 @@ +#! /usr/bin/env sh + +for arg in "$@"; do + case "$arg" in + "--help" | "-h") + cat <<-EOF + valgrind_test.sh [BINARY_NAME] [ARGS_FOR_BINARY..] +EOF + exit 0 + ;; + esac +done + +binary_name="${1-main}" +[ -n "$1" ] && shift 1 + +log_file="$(git rev-parse --show-toplevel)/target/valgrind_out.report" +mkdir --parents "$(dirname "$log_file")" + +CFLAGS="-ggdb3" make "$binary_name" + +valgrind --leak-check=full \ + --show-leak-kinds=all \ + --show-error-list=yes \ + --track-origins=yes \ + --log-file="$log_file" \ + "./target/$binary_name" "$@" + +cat "$log_file" |