2015-03-13 22:44:31 +01:00
|
|
|
build_tests = test-compile-pedantic test-link
|
|
|
|
|
|
|
|
|
|
if ENABLE_STATIC_LINK_TEST
|
|
|
|
|
build_tests += test-static-link
|
|
|
|
|
endif
|
|
|
|
|
|
2014-08-25 10:56:10 +10:00
|
|
|
noinst_PROGRAMS = $(build_tests)
|
|
|
|
|
|
|
|
|
|
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/libevdev
|
|
|
|
|
AM_LDFLAGS =
|
|
|
|
|
|
|
|
|
|
test_compile_pedantic_SOURCES = test-compile-pedantic.c
|
2015-02-09 12:54:36 +10:00
|
|
|
test_compile_pedantic_CFLAGS = $(AM_CPPFLAGS) -pedantic -Werror -std=c89
|
2014-08-25 10:56:10 +10:00
|
|
|
|
|
|
|
|
test_link_SOURCES = test-link.c
|
|
|
|
|
test_link_CFLAGS = -I$(top_srcdir)
|
|
|
|
|
test_link_LDADD = $(top_builddir)/libevdev/libevdev.la
|
|
|
|
|
|
|
|
|
|
test_static_link_SOURCES = test-link.c
|
|
|
|
|
test_static_link_CFLAGS = -I$(top_srcdir)
|
|
|
|
|
test_static_link_LDADD = $(top_builddir)/libevdev/libevdev.la
|
|
|
|
|
test_static_link_LDFLAGS = $(AM_LDFLAGS) -static
|
|
|
|
|
|
|
|
|
|
check_local_deps =
|
|
|
|
|
|
|
|
|
|
if ENABLE_RUNTIME_TESTS
|
2018-06-15 14:40:18 +10:00
|
|
|
run_tests = \
|
|
|
|
|
test-libevdev \
|
|
|
|
|
test-kernel \
|
|
|
|
|
test-uinput \
|
|
|
|
|
test-event-codes \
|
|
|
|
|
test-libevdev-internals \
|
|
|
|
|
$(NULL)
|
2013-06-04 11:11:57 +10:00
|
|
|
|
2014-04-24 11:14:34 +10:00
|
|
|
.NOTPARALLEL:
|
|
|
|
|
|
2014-08-25 10:56:10 +10:00
|
|
|
noinst_PROGRAMS += $(run_tests)
|
2013-12-12 12:57:21 +10:00
|
|
|
|
|
|
|
|
TESTS = $(run_tests)
|
2013-06-04 11:11:57 +10:00
|
|
|
|
2017-01-06 09:48:48 +10:00
|
|
|
common_sources = \
|
2013-06-29 18:09:28 +10:00
|
|
|
test-common-uinput.c \
|
|
|
|
|
test-common-uinput.h \
|
|
|
|
|
test-common.c \
|
|
|
|
|
test-common.h
|
2013-06-05 11:17:11 +10:00
|
|
|
|
2013-06-22 20:00:48 +10:00
|
|
|
# include builddir for event-names.h
|
2014-08-25 10:56:10 +10:00
|
|
|
AM_CPPFLAGS += $(CHECK_CFLAGS) $(GCOV_CFLAGS)
|
|
|
|
|
AM_LDFLAGS += $(GCOV_LDFLAGS)
|
2013-06-05 17:30:08 +10:00
|
|
|
|
2018-06-15 14:40:18 +10:00
|
|
|
test_event_codes_SOURCES = \
|
2013-06-27 09:40:23 +10:00
|
|
|
test-main.c \
|
2013-10-30 08:45:27 +01:00
|
|
|
test-event-codes.c \
|
2018-06-15 14:40:18 +10:00
|
|
|
test-event-names.c \
|
2019-06-14 11:18:37 +10:00
|
|
|
test-context.c \
|
2018-06-15 14:40:18 +10:00
|
|
|
$(common_sources)
|
|
|
|
|
test_event_codes_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
|
|
|
|
test_event_codes_LDFLAGS = -no-install
|
|
|
|
|
|
|
|
|
|
test_libevdev_internals_SOURCES = \
|
|
|
|
|
test-main.c \
|
|
|
|
|
test-int-queue.c \
|
|
|
|
|
$(common_sources)
|
|
|
|
|
test_libevdev_internals_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
|
|
|
|
test_libevdev_internals_LDFLAGS = -no-install
|
|
|
|
|
|
|
|
|
|
test_uinput_SOURCES = \
|
|
|
|
|
test-main.c \
|
|
|
|
|
test-uinput.c \
|
|
|
|
|
$(common_sources)
|
|
|
|
|
test_uinput_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
|
|
|
|
test_uinput_LDFLAGS = -no-install
|
|
|
|
|
|
|
|
|
|
test_libevdev_SOURCES = \
|
|
|
|
|
test-main.c \
|
2013-06-27 09:40:23 +10:00
|
|
|
test-libevdev-init.c \
|
|
|
|
|
test-libevdev-has-event.c \
|
2013-06-27 11:03:52 +10:00
|
|
|
test-libevdev-events.c \
|
2013-06-27 09:40:23 +10:00
|
|
|
$(common_sources)
|
2013-06-05 17:30:08 +10:00
|
|
|
|
2017-01-06 09:48:48 +10:00
|
|
|
test_libevdev_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
2017-12-13 09:46:15 +10:00
|
|
|
test_libevdev_LDFLAGS = -no-install
|
2013-06-09 20:22:18 +10:00
|
|
|
|
2013-10-08 15:43:50 +10:00
|
|
|
test_kernel_SOURCES = \
|
2018-06-15 15:18:17 +10:00
|
|
|
test-main.c \
|
2013-10-08 15:43:50 +10:00
|
|
|
test-kernel.c \
|
|
|
|
|
$(common_sources)
|
2018-06-15 15:18:17 +10:00
|
|
|
|
2013-10-08 15:43:50 +10:00
|
|
|
test_kernel_CFLAGS = -I$(top_srcdir)
|
2017-01-06 09:48:48 +10:00
|
|
|
test_kernel_LDADD = $(CHECK_LIBS) $(top_builddir)/libevdev/libevdev.la
|
2013-10-08 15:43:50 +10:00
|
|
|
|
2014-04-24 11:27:14 +10:00
|
|
|
if HAVE_VALGRIND
|
|
|
|
|
VALGRIND_FLAGS=--leak-check=full \
|
|
|
|
|
--quiet \
|
|
|
|
|
--error-exitcode=3 \
|
|
|
|
|
--suppressions=$(srcdir)/valgrind.suppressions
|
|
|
|
|
|
|
|
|
|
valgrind:
|
2018-07-09 11:48:21 +10:00
|
|
|
$(MAKE) check-TESTS CK_TIMEOUT_MULTIPLIER=10 LOG_COMPILER="$(VALGRIND)" LOG_FLAGS="$(VALGRIND_FLAGS)"
|
2014-04-24 11:27:14 +10:00
|
|
|
|
2014-08-19 08:16:37 +10:00
|
|
|
check_local_deps += valgrind
|
2014-04-24 11:27:14 +10:00
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
2013-06-05 17:30:08 +10:00
|
|
|
if GCOV_ENABLED
|
2013-06-26 17:31:15 +10:00
|
|
|
|
2017-01-06 09:48:48 +10:00
|
|
|
CLEANFILES = gcov-reports/*.gcov gcov-reports/summary.txt *.gcno *.gcda
|
|
|
|
|
|
|
|
|
|
gcov-report: generate-gcov-report.sh check-TESTS
|
|
|
|
|
$(AM_V_GEN)$(srcdir)/generate-gcov-report.sh gcov-reports $(top_builddir)/libevdev $(builddir)
|
2013-06-05 17:30:08 +10:00
|
|
|
|
2017-01-06 09:48:48 +10:00
|
|
|
gcov: gcov-report
|
|
|
|
|
@cat gcov-reports/summary.txt
|
2013-06-05 17:30:08 +10:00
|
|
|
|
2014-08-19 08:16:37 +10:00
|
|
|
check_local_deps += gcov
|
2013-06-05 17:30:08 +10:00
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
gcov-report.txt:
|
|
|
|
|
@true
|
|
|
|
|
|
|
|
|
|
gcov:
|
|
|
|
|
@true
|
|
|
|
|
|
|
|
|
|
|
2017-01-06 11:20:04 +10:00
|
|
|
endif # GCOV_ENABLED
|
2013-06-05 17:30:08 +10:00
|
|
|
|
2017-01-06 09:48:48 +10:00
|
|
|
.PHONY: gcov gcov-clean gcov-report
|
2013-06-05 17:30:08 +10:00
|
|
|
|
2014-08-25 10:56:10 +10:00
|
|
|
endif # ENABLE_RUNTIME_TESTS
|
2013-06-26 17:31:15 +10:00
|
|
|
|
2015-03-13 22:44:31 +01:00
|
|
|
if ENABLE_STATIC_SYMBOL_LEAKS_TEST
|
2020-02-18 19:21:47 +10:00
|
|
|
static-symbol-leaks: test-static-link test-static-symbols-leak.sh
|
|
|
|
|
$(AM_V_GEN) $(srcdir)/test-static-symbols-leak.sh $(builddir)
|
2014-08-19 08:16:37 +10:00
|
|
|
|
2014-08-19 09:16:39 +10:00
|
|
|
check_local_deps += static-symbol-leaks
|
2020-02-18 19:21:47 +10:00
|
|
|
|
2014-08-25 10:56:10 +10:00
|
|
|
endif # HAVE_NM
|
2014-08-19 09:16:39 +10:00
|
|
|
|
2020-02-18 19:21:47 +10:00
|
|
|
EXTRA_DIST = valgrind.suppressions generate-gcov-report.sh test-static-symbols-leak.sh
|
2020-02-18 19:39:01 +10:00
|
|
|
|
2014-08-19 09:16:39 +10:00
|
|
|
check-local: $(check_local_deps)
|
2014-08-25 10:56:10 +10:00
|
|
|
|