std_allocator and testing

This commit is contained in:
2025-10-03 20:21:27 +02:00
parent fb129ac32f
commit 5fed6d24d8
4 changed files with 71 additions and 24 deletions
+24
View File
@@ -0,0 +1,24 @@
# Makefile
# Compiler and flags
CC := gcc
CFLAGS := -Wall -Wextra -O2
LDFLAGS := -lcriterion
# Output binary
TESTBIN := /tmp/all_tests
# Phony target
.PHONY: test
test:
@echo "Discovering test files..."
@files=$$(find . -type f -name 'test*.c'); \
if [ -z "$$files" ]; then \
echo "No test files found!"; \
else \
echo "Compiling all test files into $(TESTBIN)..."; \
$(CC) $(CFLAGS) $$files -o $(TESTBIN) $(LDFLAGS); \
echo "Running tests..."; \
$(TESTBIN); \
fi