mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2026-05-08 21:48:06 +02:00
test: run all tests through valgrind
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
parent
974e330ac2
commit
a93baace89
3 changed files with 44 additions and 2 deletions
|
|
@ -68,9 +68,12 @@ AC_SUBST([GNU_LD_FLAGS], $with_ldflags)
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG()
|
PKG_PROG_PKG_CONFIG()
|
||||||
PKG_CHECK_MODULES(CHECK, [check >= 0.9.9], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
|
PKG_CHECK_MODULES(CHECK, [check >= 0.9.9], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
|
||||||
if test "x$HAVE_CHECK" != "xyes"; then
|
if test "x$HAVE_CHECK" = "xyes"; then
|
||||||
AC_MSG_WARN([check not found - skipping building unit tests])
|
AC_PATH_PROG(VALGRIND, [valgrind])
|
||||||
|
else
|
||||||
|
AC_MSG_WARN([check not found - skipping building unit tests])
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
|
||||||
AM_CONDITIONAL(BUILD_TESTS, [test "x$HAVE_CHECK" = "xyes"])
|
AM_CONDITIONAL(BUILD_TESTS, [test "x$HAVE_CHECK" = "xyes"])
|
||||||
|
|
||||||
with_cflags=""
|
with_cflags=""
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ if BUILD_TESTS
|
||||||
run_tests = test-libevdev test-kernel
|
run_tests = test-libevdev test-kernel
|
||||||
build_tests = test-compile-pedantic test-link
|
build_tests = test-compile-pedantic test-link
|
||||||
|
|
||||||
|
EXTRA_DIST =
|
||||||
|
|
||||||
.NOTPARALLEL:
|
.NOTPARALLEL:
|
||||||
|
|
||||||
noinst_PROGRAMS = $(run_tests) $(build_tests)
|
noinst_PROGRAMS = $(run_tests) $(build_tests)
|
||||||
|
|
@ -51,6 +53,21 @@ test_kernel_SOURCES = \
|
||||||
test_kernel_CFLAGS = -I$(top_srcdir)
|
test_kernel_CFLAGS = -I$(top_srcdir)
|
||||||
test_kernel_LDADD = $(CHECK_LIBS)
|
test_kernel_LDADD = $(CHECK_LIBS)
|
||||||
|
|
||||||
|
if HAVE_VALGRIND
|
||||||
|
VALGRIND_FLAGS=--leak-check=full \
|
||||||
|
--quiet \
|
||||||
|
--error-exitcode=3 \
|
||||||
|
--suppressions=$(srcdir)/valgrind.suppressions
|
||||||
|
|
||||||
|
valgrind:
|
||||||
|
$(MAKE) check-TESTS LOG_COMPILER="$(VALGRIND)" LOG_FLAGS="$(VALGRIND_FLAGS)"
|
||||||
|
|
||||||
|
check: valgrind
|
||||||
|
|
||||||
|
EXTRA_DIST += valgrind.suppressions
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
if GCOV_ENABLED
|
if GCOV_ENABLED
|
||||||
|
|
||||||
CLEANFILES = gcov-report.txt
|
CLEANFILES = gcov-report.txt
|
||||||
|
|
|
||||||
22
test/valgrind.suppressions
Normal file
22
test/valgrind.suppressions
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
<timer_create@@GLIBC_2.3.3>
|
||||||
|
Memcheck:Param
|
||||||
|
timer_create(evp)
|
||||||
|
fun:timer_create@@GLIBC_2.3.3
|
||||||
|
fun:srunner_run
|
||||||
|
fun:main
|
||||||
|
}
|
||||||
|
{
|
||||||
|
<ioctl_EVIOCGRAB_unaddressable_bytes>
|
||||||
|
Memcheck:Param
|
||||||
|
ioctl(generic)
|
||||||
|
fun:ioctl
|
||||||
|
fun:libevdev_grab
|
||||||
|
}
|
||||||
|
{
|
||||||
|
<ioctl_EVIOCREVOKE_unaddressable_bytes>
|
||||||
|
Memcheck:Param
|
||||||
|
ioctl(generic)
|
||||||
|
fun:ioctl
|
||||||
|
fun:test_revoke*
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue