b9a26f50c6f436ca55dc9935d1597b60fc5356eb
[platform/upstream/libinput.git] / test / Makefile.am
1 if BUILD_TESTS
2 AM_CPPFLAGS = -I$(top_srcdir)/src $(CHECK_CFLAGS) $(LIBEVDEV_CFLAGS)
3
4 TEST_LIBS = liblitest.la $(CHECK_LIBS) $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS) $(top_builddir)/src/libinput.la -lm
5 TEST_CFLAGS = $(GCC_CFLAGS) $(AM_CFLAGS)
6 noinst_LTLIBRARIES = liblitest.la
7 liblitest_la_SOURCES = \
8         $(top_srcdir)/src/libinput-util.h \
9         $(top_srcdir)/src/libinput-util.c \
10         litest.h \
11         litest-int.h \
12         litest-bcm5974.c \
13         litest-keyboard.c \
14         litest-mouse.c \
15         litest-synaptics.c \
16         litest-synaptics-st.c \
17         litest-trackpoint.c \
18         litest-wacom-touch.c \
19         litest.c
20
21 run_tests = \
22             test-udev \
23             test-path \
24             test-pointer \
25             test-touch \
26             test-log \
27             test-touchpad \
28             test-misc
29 build_tests = \
30         test-build-cxx \
31         test-build-linker \
32         test-build-pedantic-c99 \
33         test-build-std-gnuc90
34
35 noinst_PROGRAMS = $(build_tests) $(run_tests)
36 TESTS = $(run_tests)
37
38 test_udev_SOURCES = udev.c
39 test_udev_CFLAGS = $(TEST_CFLAGS)
40 test_udev_LDADD = $(TEST_LIBS)
41 test_udev_LDFLAGS = -static
42
43 test_path_SOURCES = path.c
44 test_path_CFLAGS = $(TEST_CFLAGS)
45 test_path_LDADD = $(TEST_LIBS)
46 test_path_LDFLAGS = -static
47
48 test_pointer_SOURCES = pointer.c
49 test_pointer_CFLAGS = $(TEST_CFLAGS)
50 test_pointer_LDADD = $(TEST_LIBS)
51 test_pointer_LDFLAGS = -static
52
53 test_touch_SOURCES = touch.c
54 test_touch_CFLAGS = $(TEST_CFLAGS)
55 test_touch_LDADD = $(TEST_LIBS)
56 test_touch_LDFLAGS = -static
57
58 test_log_SOURCES = log.c
59 test_log_CFLAGS = $(TEST_CFLAGS)
60 test_log_LDADD = $(TEST_LIBS)
61 test_log_LDFLAGS = -static
62
63 test_touchpad_SOURCES = touchpad.c
64 test_touchpad_CFLAGS = $(AM_CPPFLAGS)
65 test_touchpad_LDADD = $(TEST_LIBS)
66 test_touchpad_LDFLAGS = -static
67
68 test_misc_SOURCES = misc.c
69 test_misc_CFLAGS = $(AM_CPPFLAGS)
70 test_misc_LDADD = $(TEST_LIBS)
71 test_misc_LDFLAGS = -static
72
73 # build-test only
74 test_build_pedantic_c99_SOURCES = build-pedantic.c
75 test_build_pedantic_c99_CFLAGS = $(TEST_CFLAGS) -std=c99 -pedantic -Werror
76
77 test_build_std_gnuc90_SOURCES = build-pedantic.c
78 test_build_std_gnuc90_CFLAGS = $(TEST_CFLAGS) -std=gnu90 -Werror
79
80 # test for linking with the minimal linker flags
81 test_build_linker_SOURCES = build-pedantic.c
82 test_build_linker_CFLAGS = -I$(top_srcdir)/src
83 test_build_linker_LDADD = $(top_builddir)/src/libinput.la
84
85 # test including from C++
86 test_build_cxx_SOURCES = build-cxx.cc
87 test_build_cxx_CXXFLAGS = -Wall -Wextra -Wno-unused-parameter $(AM_CXXFLAGS)
88
89 if HAVE_VALGRIND
90 VALGRIND_FLAGS=--leak-check=full \
91                --quiet \
92                --error-exitcode=3 \
93                --suppressions=$(srcdir)/valgrind.suppressions
94
95 valgrind:
96         $(MAKE) check-TESTS LOG_COMPILER="$(VALGRIND)" LOG_FLAGS="$(VALGRIND_FLAGS)"
97
98 check: valgrind
99
100 endif
101 endif
102 EXTRA_DIST=valgrind.suppressions