From 4942d959d5042009914e64775ace03d247e9241b Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Thu, 9 Oct 2025 20:52:27 +0200 Subject: [PATCH] run tests with valgrind --- .github/workflows/ci.yml | 2 +- makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15e73c2..bb5e641 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y gcc make libcriterion-dev + sudo apt-get install -y gcc make libcriterion-dev valgrind - name: Build and run tests run: make test diff --git a/makefile b/makefile index 9719f5c..49326d7 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ CC := gcc -CFLAGS := -Wall -Wextra -Wno-override-init -O2 -fsanitize=address +CFLAGS := -Wall -Wextra -Wno-override-init -O0 -g -fno-omit-frame-pointer -fno-inline LDFLAGS := -lcriterion TESTBIN := /tmp/all_tests @@ -16,7 +16,7 @@ test: echo "Compiling all test files into $(TESTBIN)..."; \ $(CC) $(CFLAGS) _allocator_impl.c $$files -o $(TESTBIN) $(LDFLAGS); \ echo "Running tests..."; \ - $(TESTBIN); \ + valgrind $(TESTBIN); \ fi