changes: TINF-175 TZPC-4722
[platform/upstream/libgee.git] / tests / Makefile.am
index 9007792..2a9abe3 100644 (file)
@@ -1,72 +1,92 @@
 include $(top_srcdir)/Makefile.decl
 
-NULL =
-
-AM_CPPFLAGS = \
-       -I$(top_srcdir)/gee \
-       $(GLIB_CFLAGS) \
-       $(NULL)
-
 noinst_PROGRAMS = $(TEST_PROGS)
 
-progs_ldadd = $(GLIB_LIBS) ../gee/libgee.la
-
-BUILT_SOURCES = tests.vala.stamp
-
 TEST_PROGS += tests
-tests_VALASOURCES = \
+
+tests_SOURCES = \
        testarraylist.vala \
+       testarrayqueue.vala \
+       testbidirlist.vala \
+       testbidirsortedset.vala \
+       testbidirsortedmap.vala \
        testcase.vala \
        testcollection.vala \
+       testconcurrentlist.vala \
+       testconcurrentset.vala \
+       testdata.vala \
+       testdeque.vala \
+       testfunctions.vala \
+       testhashmap.vala \
        testhashmultimap.vala \
        testhashmultiset.vala \
+       testhashset.vala \
        testlinkedlist.vala \
+       testlinkedlistasdeque.vala \
        testlist.vala \
        testmain.vala \
+       testmap.vala \
        testmultimap.vala \
        testmultiset.vala \
+       testpriorityqueue.vala \
+       testqueue.vala \
+       testreadonlybidirlist.vala \
+       testreadonlycollection.vala \
+       testreadonlylist.vala \
+       testreadonlymap.vala \
+       testreadonlyset.vala \
+       testset.vala \
+       testsortedset.vala \
+       testsortedmap.vala \
+       testtreemap.vala \
+       testtreemultimap.vala \
+       testtreemultiset.vala \
+       testtreeset.vala \
        $(NULL)
 
-tests_SOURCES = tests.vala.stamp $(tests_VALASOURCES:.vala=.c)
-tests.vala.stamp: $(tests_VALASOURCES)
-       $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
-       touch $@
-tests_LDADD = $(progs_ldadd)
-EXTRA_DIST += $(tests_VALASOURCES)
+tests_DEPENDENCIES = \
+       $(top_srcdir)/gee/gee-0.8.vapi \
+       $(NULL)
+
+tests_VALAFLAGS = \
+       --basedir $(top_srcdir) \
+       --vapidir $(top_srcdir)/gee \
+       --pkg gee-0.8 --pkg posix \
+       $(VALAFLAGS) \
+       $(NULL)
+
+tests_CPPFLAGS = \
+       -I$(top_srcdir)/gee \
+       $(GLIB_CFLAGS) \
+       $(NULL)
+
+tests_LDADD = \
+       $(GLIB_LIBS) ../gee/libgee-0.8.la \
+       $(NULL)
+
+coverage-reset:
+       lcov --base-directory=@top_srcdir@ --directory @top_srcdir@/gee --zerocounters
 
-TEST_PROGS += testhashmap
-testhashmap_VALASOURCES = testhashmap.vala
-testhashmap_SOURCES = testhashmap.c
-$(testhashmap_SOURCES): $(testhashmap_VALASOURCES)
-       $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
-       touch $@
-testhashmap_LDADD = $(progs_ldadd)
-EXTRA_DIST += $(testhashmap_VALASOURCES)
+coverage-report:
+       lcov --directory @top_srcdir@/gee \
+               --capture \
+               --output-file @top_builddir@/lcov.info
 
-TEST_PROGS += testhashset
-testhashset_VALASOURCES = testhashset.vala
-testhashset_SOURCES = testhashset.c
-$(testhashset_SOURCES): $(testhashset_VALASOURCES)
-       $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
-       touch $@
-testhashset_LDADD = $(progs_ldadd)
-EXTRA_DIST += $(testhashset_VALASOURCES)
+       lcov --directory @top_srcdir@/gee \
+               --output-file @top_builddir@/lcov.info \
+               --remove @top_builddir@/lcov.info \
+               "/usr/include/*" "*.c" "*.h" "*.vapi"
 
-TEST_PROGS += testtreeset
-testtreeset_VALASOURCES = testtreeset.vala
-testtreeset_SOURCES = testtreeset.c testtreeset.h
-$(testtreeset_SOURCES): $(testtreeset_VALASOURCES)
-       $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
-       touch $@
-testtreeset_LDADD = $(progs_ldadd)
-EXTRA_DIST += $(testtreeset_VALASOURCES)
+       $(mkdir_p) @top_builddir@/tests/coverage
+       git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
+       genhtml --title "@PACKAGE_STRING@ $$git_commit" \
+               --output-directory @top_builddir@/tests/coverage @top_builddir@/lcov.info
+       @echo
+       @echo 'lcov report can be found in:'
+       @echo 'file://@abs_top_builddir@/tests/coverage/index.html'
+       @echo
 
-TEST_PROGS += testtreemap
-testtreemap_VALASOURCES = testtreemap.vala
-testtreemap_SOURCES = testtreemap.c testtreemap.h
-$(testtreemap_SOURCES): $(testtreemap_VALASOURCES)
-       $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
-       touch $@
-testtreemap_LDADD = $(progs_ldadd)
-EXTRA_DIST += $(testtreemap_VALASOURCES)
+clean-local:
+       -rm -rf coverage
 
+.PHONY: coverage-report