2 run_tests = test-libevdev test-kernel
3 build_tests = test-compile-pedantic test-link
7 noinst_PROGRAMS = $(run_tests) $(build_tests)
11 libevdev_sources = $(top_srcdir)/libevdev/libevdev.c \
12 $(top_srcdir)/libevdev/libevdev.h \
13 $(top_srcdir)/libevdev/libevdev-names.c \
14 $(top_srcdir)/libevdev/libevdev-uinput.h \
15 $(top_srcdir)/libevdev/libevdev-uinput.c \
16 $(top_srcdir)/libevdev/libevdev-uinput-int.h \
17 $(top_srcdir)/libevdev/libevdev-util.h \
18 $(top_srcdir)/libevdev/libevdev-int.h
19 common_sources = $(libevdev_sources) \
20 test-common-uinput.c \
21 test-common-uinput.h \
25 # include builddir for event-names.h
26 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/libevdev $(CHECK_CFLAGS) $(GCOV_CFLAGS)
28 test_libevdev_SOURCES = \
32 test-libevdev-init.c \
33 test-libevdev-has-event.c \
35 test-libevdev-events.c \
39 test_libevdev_LDADD = $(CHECK_LIBS) $(GCOV_LDFLAGS)
41 test_compile_pedantic_SOURCES = test-compile-pedantic.c
42 test_compile_pedantic_CFLAGS = $(AM_CPPFLAGS) -pedantic -Werror -std=c90
44 test_link_SOURCES = test-link.c
45 test_link_CFLAGS = -I$(top_srcdir)
46 test_link_LDADD = $(top_builddir)/libevdev/libevdev.la
48 test_kernel_SOURCES = \
51 test_kernel_CFLAGS = -I$(top_srcdir)
52 test_kernel_LDADD = $(CHECK_LIBS)
55 VALGRIND_FLAGS=--leak-check=full \
58 --suppressions=$(srcdir)/valgrind.suppressions
61 $(MAKE) check-TESTS LOG_COMPILER="$(VALGRIND)" LOG_FLAGS="$(VALGRIND_FLAGS)"
67 EXTRA_DIST = valgrind.suppressions
71 CLEANFILES = gcov-report.txt
76 gcov-report.txt: gcov-clean check-TESTS
77 $(AM_V_GEN)(rm -rf $@; \
78 echo "========== coverage report ========" >> $@; \
79 for file in `find $(top_srcdir)/libevdev -name "*.c" -printf "%P\n"`; do \
80 gcov $$file > /dev/null; \
81 if test -f $$file.gcov; then \
82 total=`grep -v " -:" $$file.gcov | wc -l`; \
83 missing=`grep "#####" $$file.gcov | wc -l`; \
84 hit=$$((total - missing)); \
85 echo -e "$$file: total lines: $$total not tested: $$missing ($$((($$hit * 100)/$$total))%)"; \
88 echo "========== =============== ========" >> $@; \
109 .PHONY: gcov gcov-clean gcov-report.txt
111 clean-local: gcov-clean