1 EXTRA_DIST = \
2 coverage.sh \
3 testwrapper.sh \
4 integration/simple_config.sh \
5 integration/simple_query.sh \
6 integration/test_lib.sh \
7 valgrind.suppress
9 # coverage related flags are only set when gcov is enabled
10 AM_CFLAGS = @STRICT_CFLAGS@ @COVERAGE_CFLAGS@
11 AM_LDFLAGS = @COVERAGE_LDFLAGS@
12 AM_CPPFLAGS = -I$(top_srcdir)/src/include
14 TESTS =
15 check_PROGRAMS =
16 check_LTLIBRARIES =
18 #
19 # unit tests
20 #
22 LOG_COMPILER = $(abs_srcdir)/testwrapper.sh
24 if UNIT_TESTING
25 TESTS += unit/libsysdb_test unit/libsysdb_net_test
26 check_PROGRAMS += unit/libsysdb_test unit/libsysdb_net_test
27 endif
29 unit_libsysdb_test_SOURCES = \
30 unit/libsysdb_test.c unit/libsysdb_test.h \
31 unit/libsysdb_testutils.c unit/libsysdb_testutils.h \
32 unit/core/data_test.c \
33 unit/core/object_test.c \
34 unit/core/store_test.c \
35 unit/core/store_lookup_test.c \
36 unit/core/time_test.c \
37 unit/frontend/connection_test.c \
38 unit/frontend/parser_test.c \
39 unit/frontend/sock_test.c \
40 unit/utils/avltree_test.c \
41 unit/utils/channel_test.c \
42 unit/utils/dbi_test.c \
43 unit/utils/llist_test.c \
44 unit/utils/os_test.c \
45 unit/utils/strbuf_test.c
46 unit_libsysdb_test_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@ -I$(top_srcdir)/t/unit
47 unit_libsysdb_test_LDADD = $(top_builddir)/src/libsysdb.la @CHECK_LIBS@
49 unit_libsysdb_net_test_SOURCES = \
50 unit/libsysdb_net_test.c unit/libsysdb_test.h \
51 unit/libsysdb_testutils.c unit/libsysdb_testutils.h
52 if BUILD_WITH_FOPENCOOKIE
53 unit_libsysdb_net_test_SOURCES += unit/utils/unixsock_test.c
54 endif
55 unit_libsysdb_net_test_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@ -I$(top_srcdir)/t/unit
56 unit_libsysdb_net_test_LDADD = $(top_builddir)/src/libsysdb.la @CHECK_LIBS@
58 #
59 # integration tests
60 #
62 if INTEGRATION_TESTING
63 TESTS += integration/simple_config.sh integration/simple_query.sh
64 endif
66 check_LTLIBRARIES += integration/mock_plugin.la
67 integration_mock_plugin_la_SOURCES = integration/mock_plugin.c
68 # -rpath is a work-around to enforce a shared library
69 integration_mock_plugin_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
70 -rpath /nonexistent
72 test: check