Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. testutils_files := testutils/comparators.c;testutils/list.c;testutils/domtsasserts.c
  2. testutils_files := $(testutils_files);testutils/utils.c;testutils/foreach.c;testutils/load.c
  3.  
  4. TESTCFLAGS := $(TESTCFLAGS) -I$(DIR) -I$(DIR)testutils -Ibindings/xml -Ibindings/hubbub -Wno-unused -fno-strict-aliasing
  5.  
  6. ALL_XML_TESTS :=
  7.  
  8. # 1: Path to XML file
  9. # 2: Fragment C file name
  10. # 3: DTD file
  11. # 4: Test name
  12. define do_xml_test
  13.  
  14.  
  15. ifeq ($$(WANT_TEST),yes)
  16.  
  17. $(DIR)$2: $(DIR)testcases/tests/$1 $(DIR)transform.pl  $(DIR)DOMTSHandler.pm
  18.         $(VQ)$(ECHO) "   XFORM: $1"
  19.         $(Q)$(PERL) $(DIR)transform.pl $(DIR)$3 $(DIR)testcases/tests/$(dir $1)/files $(DIR)testcases/tests/$1 > $(DIR)$2
  20.  
  21. DIR_TEST_ITEMS := $$(DIR_TEST_ITEMS) $4:$2;$(testutils_files)
  22.  
  23. endif
  24.  
  25. DISTCLEAN_ITEMS := $$(DISTCLEAN_ITEMS) $(DIR)$2
  26.  
  27. ALL_XML_TESTS := $$(ALL_XML_TESTS) $4
  28.  
  29.  
  30.  
  31. endef
  32.  
  33. # 1: suite base
  34. # 2: dtd for suite
  35. define do_xml_suite
  36.  
  37. $(foreach XML,$(filter-out $1/metadata.xml,$(filter-out $1/alltests.xml,$(subst $(DIR)testcases/tests/,,$(wildcard $(DIR)testcases/tests/$1/*.xml)))),$(call do_xml_test,$(XML),$(subst /,_,$(XML:.xml=.c)),$2,$(subst /,_,$(XML:.xml=))))
  38.  
  39. endef
  40.  
  41. # 1: test name
  42. define write_index
  43.  
  44.         $(Q)$(ECHO) "$1 $1" >> $@
  45.  
  46. endef
  47.  
  48. $(DIR)INDEX: test/Makefile
  49.         $(VQ)$(ECHO) "   INDEX: Making test index"
  50.         $(Q)$(ECHO) "#test      desc    dir" > $@
  51.         $(foreach XMLTEST,$(sort $(ALL_XML_TESTS)),$(call write_index,$(XMLTEST)))
  52.  
  53. TEST_PREREQS := $(TEST_PREREQS) $(DIR)INDEX
  54.  
  55. # Include the level 1 core tests
  56. $(eval $(call do_xml_suite,level1/core,dom1-interfaces.xml))
  57. # Include level 1 html tests
  58. $(eval $(call do_xml_suite,level1/html,dom1-interfaces.xml))
  59.  
  60. # Include the level 2 core tests
  61. $(eval $(call do_xml_suite,level2/core,dom2-core-interface.xml))
  62.  
  63. CLEAN_ITEMS := $(DIR)INDEX
  64.  
  65. include $(NSBUILD)/Makefile.subdir
  66.  
  67.