summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Makefile42
1 files changed, 18 insertions, 24 deletions
diff --git a/test/Makefile b/test/Makefile
index d9ca503..e4e42d5 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,4 @@
-testlib_files := lib/comparators.c;lib/list.c;lib/testassert.c;
+testlib_files := lib/comparators.c;lib/list.c;lib/testassert.c
testlib_files := $(testlib_files);lib/testobject.c;lib/utils.c
TESTCFLAGS := $(TESTCFLAGS) -I$(CURDIR)
@@ -6,28 +6,22 @@ TESTCFLAGS := $(TESTCFLAGS) -I$(CURDIR)
DIR_TEST_ITEMS := binding:binding.c;$(testlib_files) \
test-list:test-list.c;$(testlib_files)
-include build/makefiles/Makefile.subdir
+define add_xml_test
+ ifeq ($$(WANT_TEST),yes)
+ $(DIR)xml/c/$1.c: $(DIR)xml/tests/$1.xml
+ $$(Q)$$(XSLTPROC) $$(XSLTPROCFLAGS) -o $$@ \
+ $(DIR)transform/test-to-c.xsl $$<
+
+ DIR_TEST_ITEMS := $$(DIR_TEST_ITEMS) $1:xml/c/$1.c;$$(testlib_files)
+ endif
+
+ DISTCLEAN_ITEMS := $$(DISTCLEAN_ITEMS) $(DIR)xml/c/$1.c
-# TODO: XML suite
-#
-# Transformer input
-#XMLFILES = $(wildcard xml/tests/*.xml)
-#
-# Transformer output
-#CFILES = $(addprefix xml/c/, $(notdir $(XMLFILES:.xml=.c)))
-#
-# Objects
-#XMLOBJS = $(addprefix xml/bin/, $(notdir $(XMLFILES:.xml=)))
-#
-#transform: $(CFILES)
-#
-# Pattern rules
-#xml/bin/%: xml/c/%.c
-# @${ECHO} ${ECHOFLAGS} "==> $<"
-# @${CC} -c -g ${CFLAGS} -o $@.o $<
-# @${LD} -g -o $@ $@.o ${LDFLAGS} $(LIBS)
-# @${RM} ${RMFLAGS} $@.o
-#
-#xml/c/%.c: xml/tests/%.xml
-# @${XSLT} ${XSLTFLAGS} -o $@ transform/test-to-c.xsl $<
+endef
+
+# Add DOMTS tests to the list of items to build
+$(eval $(foreach XML,$(wildcard $(DIR)xml/tests/*.xml), \
+ $(call add_xml_test,$(basename $(notdir $(XML))))))
+
+include build/makefiles/Makefile.subdir