2013-06-09 20:22:18 +10:00
|
|
|
noinst_PROGRAMS = test-event-names test-libevdev-init test-libevdev-has-event test-int-queue
|
2013-06-04 11:11:57 +10:00
|
|
|
|
|
|
|
|
TESTS = $(noinst_PROGRAMS)
|
|
|
|
|
|
2013-06-05 16:50:48 +10:00
|
|
|
libevdev_sources = $(top_srcdir)/libevdev/libevdev.c \
|
|
|
|
|
$(top_srcdir)/libevdev/libevdev.h \
|
|
|
|
|
$(top_srcdir)/libevdev/libevdev-util.h \
|
|
|
|
|
$(top_srcdir)/libevdev/libevdev-int.h
|
|
|
|
|
common_sources = $(libevdev_sources) test-common-uinput.c test-common-uinput.h
|
2013-06-05 11:17:11 +10:00
|
|
|
|
2013-06-22 20:00:48 +10:00
|
|
|
# include builddir for event-names.h
|
|
|
|
|
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)/libevdev $(CHECK_CFLAGS) $(GCOV_CFLAGS)
|
2013-06-05 17:30:08 +10:00
|
|
|
|
|
|
|
|
|
2013-06-04 11:11:57 +10:00
|
|
|
|
2013-06-05 11:17:11 +10:00
|
|
|
test_event_names_SOURCES = test-event-names.c $(common_sources)
|
2013-06-05 17:30:08 +10:00
|
|
|
test_event_names_LDADD = $(CHECK_LIBS) $(GCOV_LDFLAGS)
|
2013-06-04 11:11:57 +10:00
|
|
|
|
2013-06-05 11:17:11 +10:00
|
|
|
test_libevdev_init_SOURCES = test-libevdev-init.c $(common_sources)
|
2013-06-05 17:30:08 +10:00
|
|
|
test_libevdev_init_LDADD = $(CHECK_LIBS) $(GCOV_LDFLAGS)
|
2013-06-05 15:31:00 +10:00
|
|
|
|
|
|
|
|
test_libevdev_has_event_SOURCES = test-libevdev-has-event.c $(common_sources)
|
2013-06-05 17:30:08 +10:00
|
|
|
test_libevdev_has_event_LDADD = $(CHECK_LIBS) $(GCOV_LDFLAGS)
|
|
|
|
|
|
2013-06-09 20:22:18 +10:00
|
|
|
test_int_queue_SOURCES = test-int-queue.c $(common_sources)
|
|
|
|
|
test_int_queue_LDADD = $(CHECK_LIBS) $(GCOV_LDFLAGS)
|
|
|
|
|
|
2013-06-05 17:30:08 +10:00
|
|
|
if GCOV_ENABLED
|
2013-06-26 17:31:15 +10:00
|
|
|
|
|
|
|
|
CLEANFILES = gcov-report.txt
|
|
|
|
|
|
2013-06-05 17:30:08 +10:00
|
|
|
gcov-clean:
|
|
|
|
|
@rm -f *.gcov
|
|
|
|
|
|
|
|
|
|
gcov-report.txt: gcov-clean check-TESTS
|
|
|
|
|
$(AM_V_GEN)(rm -rf $@; \
|
|
|
|
|
echo "========== coverage report ========" >> $@; \
|
|
|
|
|
for file in `find $(top_srcdir)/libevdev -name "*.c" -printf "%P\n"`; do \
|
|
|
|
|
gcov $$file > /dev/null; \
|
|
|
|
|
if test -f $$file.gcov; then \
|
|
|
|
|
total=`grep -v " -:" $$file.gcov | wc -l`; \
|
|
|
|
|
missing=`grep "#####" $$file.gcov | wc -l`; \
|
|
|
|
|
hit=$$((total - missing)); \
|
|
|
|
|
echo -e "$$file: total lines: $$total not tested: $$missing ($$((($$hit * 100)/$$total))%)"; \
|
|
|
|
|
fi \
|
|
|
|
|
done >> $@; \
|
|
|
|
|
echo "========== =============== ========" >> $@; \
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
gcov: gcov-report.txt
|
|
|
|
|
@cat gcov-report.txt
|
|
|
|
|
|
|
|
|
|
check-local: gcov
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
gcov-report.txt:
|
|
|
|
|
@true
|
|
|
|
|
|
|
|
|
|
gcov:
|
|
|
|
|
@true
|
|
|
|
|
|
|
|
|
|
gcov-clean:
|
|
|
|
|
@true
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
.PHONY: gcov gcov-clean gcov-report.txt
|
|
|
|
|
|
|
|
|
|
clean-local: gcov-clean
|
|
|
|
|
rm -f *.gcno *.gcda
|
2013-06-26 17:31:15 +10:00
|
|
|
|