brewery
notashelf /
e871307f6a9536ce9d7e95fe8157937ce4908c9a

chroma

public

Lightweight wallpaper daemon for Wayland

Star0tarball
clone
ssh://git@git.notashelf.dev:33/notashelf/chroma.git

Commit e871307f6a95

tarball

NotAShelf <raf@notashelf.dev> · 2026-04-16 13:03 UTC

unverified1 files changed+29-5
chore: add more Make tasks for tests & benchmarks

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5cabfcf1815588ffec6c8b865cd163176a6a6964
diff --git a/Makefile b/Makefileindex 0efc0bd..f26050d 100644--- a/Makefile+++ b/Makefile@@ -131,11 +131,12 @@ clean: 	@echo "Cleaning build artifacts..." 	rm -rf $(OBJDIR) $(BINDIR) 	rm -f $(PROTOCOL_HEADERS) $(PROTOCOL_SOURCES)+	rm -f "vcore.*"  # Format source code (requires clang-format) format: 	@echo "Formatting source code..."-	@find $(SRCDIR) $(INCDIR) -name "*.c" -o -name "*.h" | xargs clang-format -i+	@find $(SRCDIR) -name "*.c" -o -name "*.h" | xargs clang-format -i  # Static analysis (requires cppcheck) analyze:@@ -147,10 +148,33 @@ analyze: 		$(SRCDIR)  # Run tests-# FIXME: add tests test: $(TARGET)-	@echo "Running tests..."-	@echo "Tests not implemented yet."+	@echo "Running unit tests..."+	@$(CC) -o bin/test tests/test.c lib/test_common.c \+		-I./include -I./tests -I./tests/util -lm -std=c11 -D_GNU_SOURCE $(CFLAGS)+	@./bin/test++# Run benchmarks+bench:+	@echo "Running performance benchmarks..."+	@$(CC) -o bin/bench benchmarks/bench.c lib/test_common.c \+		-I./include -I./tests -I./tests/util -lm -std=c11 -D_GNU_SOURCE $(CFLAGS)+	@./bin/bench++# Memory analysis tests+test-memory:+	@echo "Building memory tests..."+	@$(CC) -o bin/test tests/test.c lib/test_common.c \+		-I./include -I./tests -I./tests/util -lm -std=c11 -D_GNU_SOURCE $(CFLAGS)+	@valgrind --leak-check=full --show-leak-kinds=all ./bin/test 2>&1 | tee tests/memory_report.txt+	@echo "Analysis complete. See tests/memory_report.txt"++# Generate memory profile CSVs+profile-memory:+	@$(CC) -o bin/test tests/test.c lib/test_common.c \+		-I./include -I./tests -I./tests/util -lm -std=c11 -D_GNU_SOURCE $(CFLAGS)+	@./bin/test --profile+	@echo "CSV files generated in /tmp/"  # Version management targets bump-patch:@@ -213,7 +237,7 @@ help: -include $(DEPENDS)  # Phony targets-.PHONY: all debug static check-deps install uninstall systemd-service version-header sample-config clean distclean format analyze test help bump-patch bump-minor bump-major set-version+.PHONY: all debug static check-deps install uninstall systemd-service version-header clean distclean format analyze test test-memory memory-report help bump-patch bump-minor bump-major set-version  # Print variables print-%: