diff options
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 62 |
1 files changed, 59 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am index 5061f46..de57c46 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,8 @@ INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAG noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ testThreads testC14N testAutomata testRegexp \ - testReader testapi testModule runtest runsuite + testReader testapi testModule runtest runsuite testchar \ + testdict runxmlconf testrecurse bin_PROGRAMS = xmllint xmlcatalog @@ -55,6 +56,21 @@ runtest_LDFLAGS = runtest_DEPENDENCIES = $(DEPS) runtest_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) +testrecurse_SOURCES=testrecurse.c +testrecurse_LDFLAGS = +testrecurse_DEPENDENCIES = $(DEPS) +testrecurse_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS) + +testchar_SOURCES=testchar.c +testchar_LDFLAGS = +testchar_DEPENDENCIES = $(DEPS) +testchar_LDADD= @RDL_LIBS@ $(LDADDS) + +testdict_SOURCES=testdict.c +testdict_LDFLAGS = +testdict_DEPENDENCIES = $(DEPS) +testdict_LDADD= @RDL_LIBS@ $(LDADDS) + runsuite_SOURCES=runsuite.c runsuite_LDFLAGS = runsuite_DEPENDENCIES = $(DEPS) @@ -150,12 +166,25 @@ testapi_LDFLAGS = testapi_DEPENDENCIES = $(DEPS) testapi_LDADD= $(LDADDS) +runxmlconf_SOURCES=runxmlconf.c +runxmlconf_LDFLAGS = +runxmlconf_DEPENDENCIES = $(DEPS) +runxmlconf_LDADD= $(LDADDS) + #testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c #testOOM_LDFLAGS = #testOOM_DEPENDENCIES = $(DEPS) #testOOM_LDADD= $(LDADDS) -check-local: all tests +runtests: + $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) + +check: all runtests + +check-valgrind: all + @echo '## Running the regression tests under Valgrind' + @echo '## Go get a cup of coffee it is gonna take a while ...' + $(MAKE) CHECKER='valgrind -q' check testall : tests SVGtests SAXtests @@ -1105,6 +1134,8 @@ ModuleTests: testModule$(EXEEXT) testdso.la cleanup: -@(find . -name .\#\* -exec rm {} \;) + -@(find . -name \*.gcda -o *.gcno -exec rm {} \;) + -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;) dist-hook: cleanup libxml2.spec -cp libxml2.spec $(distdir) @@ -1139,7 +1170,7 @@ xml2Conf.sh: xml2Conf.sh.in Makefile < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ && mv xml2Conf.tmp xml2Conf.sh -CLEANFILES=xml2Conf.sh +CLEANFILES=xml2Conf.sh *.gcda *.gcno confexecdir=$(libdir) confexec_DATA = xml2Conf.sh @@ -1191,3 +1222,28 @@ tst: tst.c sparse: clean $(MAKE) CC=cgcc + +# +# Coverage support, largely borrowed from libvirt +# Both binaries comes from the lcov package in Fedora +# +LCOV = /usr/bin/lcov +GENHTML = /usr/bin/genhtml + +cov: clean-cov + if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \ + echo not configured with coverage; exit 1 ; fi + if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \ + echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi + -@($(MAKE) check) + -@(./runsuite$(EXEEXT)) + mkdir $(top_builddir)/coverage + $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir) + $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr* + rm $(top_builddir)/coverage/libxml2.info.tmp + $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info + echo "Coverage report is in $(top_builddir)/coverage/index.html" + +clean-cov: + rm -rf $(top_builddir)/coverage + |