Refactor the Map implementations' tests
[platform/upstream/libgee.git] / tests / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 NULL =
4
5 AM_CPPFLAGS = \
6         -I$(top_srcdir)/gee \
7         $(GLIB_CFLAGS) \
8         $(NULL)
9
10 noinst_PROGRAMS = $(TEST_PROGS)
11
12 progs_ldadd = $(GLIB_LIBS) ../gee/libgee.la
13
14 BUILT_SOURCES = tests.vala.stamp
15
16 TEST_PROGS += tests
17 tests_VALASOURCES = \
18        testarraylist.vala \
19        testcase.vala \
20        testcollection.vala \
21        testdeque.vala \
22        testhashmap.vala \
23        testhashmultimap.vala \
24        testhashmultiset.vala \
25        testlinkedlist.vala \
26        testlinkedlistasdeque.vala \
27        testlist.vala \
28        testmain.vala \
29        testmap.vala \
30        testmultimap.vala \
31        testmultiset.vala \
32        testqueue.vala \
33        testreadonlycollection.vala \
34        testreadonlylist.vala \
35        testtreemap.vala \
36        $(NULL)
37
38 tests_SOURCES = tests.vala.stamp $(tests_VALASOURCES:.vala=.c)
39 tests.vala.stamp: $(tests_VALASOURCES)
40         $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
41         touch $@
42 tests_LDADD = $(progs_ldadd)
43 EXTRA_DIST += $(tests_VALASOURCES)
44
45 coverage-reset:
46         lcov --base-directory=@top_srcdir@ --directory @top_srcdir@/gee --zerocounters
47
48 coverage-report:
49         lcov --directory @top_srcdir@/gee \
50                 --capture \
51                 --output-file @top_builddir@/lcov.info
52
53         lcov --directory @top_srcdir@/gee \
54                 --output-file @top_builddir@/lcov.info \
55                 --remove @top_builddir@/lcov.info \
56                 /usr/include/\*
57
58         $(mkdir_p) @top_builddir@/tests/coverage
59         git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\
60         genhtml --title "@PACKAGE_STRING@ $$git_commit" \
61                 --output-directory @top_builddir@/tests/coverage @top_builddir@/lcov.info
62         @echo
63         @echo 'lcov report can be found in:'
64         @echo 'file://@abs_top_builddir@/tests/coverage/index.html'
65         @echo
66
67 clean-local:
68         -rm -rf coverage
69
70 .PHONY: coverage-report
71
72 TEST_PROGS += testhashset
73 testhashset_VALASOURCES = testhashset.vala
74 testhashset_SOURCES = testhashset.c
75 $(testhashset_SOURCES): $(testhashset_VALASOURCES)
76         $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
77         touch $@
78 testhashset_LDADD = $(progs_ldadd)
79 EXTRA_DIST += $(testhashset_VALASOURCES)
80
81 TEST_PROGS += testtreeset
82 testtreeset_VALASOURCES = testtreeset.vala
83 testtreeset_SOURCES = testtreeset.c testtreeset.h
84 $(testtreeset_SOURCES): $(testtreeset_VALASOURCES)
85         $(VALAC) -C --basedir $(top_srcdir) --vapidir $(top_srcdir)/gee --pkg gee-1.0 $^
86         touch $@
87 testtreeset_LDADD = $(progs_ldadd)
88 EXTRA_DIST += $(testtreeset_VALASOURCES)