diff options
Diffstat (limited to '')
-rw-r--r-- | src/Makefile.am | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index cf56ba1fb..653ccb824 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -151,3 +151,15 @@ sparse-check: $(SPARSE) -I. $(mpd_CFLAGS) $(SPARSE_FLAGS) $(srcdir)/$$i || exit; \ done +TEST_CFLAGS = -DUNIT_TEST +TEST_FILES := $(shell grep UNIT_TEST $(mpd_SOURCES) | \ + awk -F: '{print $$1}' | uniq) + +test: $(addprefix test-, $(subst .c,,$(TEST_FILES))) + +test-%: %.c + $(CC) $(CFLAGS) $(TEST_CFLAGS) -o $@ $< + @./$@ + @echo $@: OK + +.PHONY: sparse-check test |