mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-20 08:00:09 +01:00
test: change the static symbol leak test to a shell script
Easier to call from meson this way Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
cd9fd458a5
commit
d654a8edf8
2 changed files with 23 additions and 18 deletions
|
|
@ -130,28 +130,14 @@ endif # GCOV_ENABLED
|
||||||
endif # ENABLE_RUNTIME_TESTS
|
endif # ENABLE_RUNTIME_TESTS
|
||||||
|
|
||||||
if ENABLE_STATIC_SYMBOL_LEAKS_TEST
|
if ENABLE_STATIC_SYMBOL_LEAKS_TEST
|
||||||
# Hack to check for leaking symbols in the static library.
|
static-symbol-leaks: test-static-link test-static-symbols-leak.sh
|
||||||
# See https://bugs.freedesktop.org/show_bug.cgi?id=82785
|
$(AM_V_GEN) $(srcdir)/test-static-symbols-leak.sh $(builddir)
|
||||||
# Note the spaces in the expressions! After the first grep, each line
|
|
||||||
# is " T symbol_name"
|
|
||||||
static-symbol-leaks: test-static-link
|
|
||||||
$(AM_V_GEN)(\
|
|
||||||
$(NM) --extern-only $(builddir)/test-static-link | \
|
|
||||||
grep -o -e " T .*" | \
|
|
||||||
grep -v -e " main$$" \
|
|
||||||
-e " atexit" \
|
|
||||||
-e " mangle_path" \
|
|
||||||
-e " *gcov.*" \
|
|
||||||
-e " _.*" \
|
|
||||||
-e " libevdev_*" && \
|
|
||||||
echo "Leaking symbols found" && \
|
|
||||||
exit 1 || exit 0 \
|
|
||||||
)
|
|
||||||
|
|
||||||
check_local_deps += static-symbol-leaks
|
check_local_deps += static-symbol-leaks
|
||||||
|
|
||||||
endif # HAVE_NM
|
endif # HAVE_NM
|
||||||
|
|
||||||
EXTRA_DIST = valgrind.suppressions generate-gcov-report.sh
|
EXTRA_DIST = valgrind.suppressions generate-gcov-report.sh test-static-symbols-leak.sh
|
||||||
|
|
||||||
check-local: $(check_local_deps)
|
check-local: $(check_local_deps)
|
||||||
|
|
||||||
|
|
|
||||||
19
test/test-static-symbols-leak.sh
Executable file
19
test/test-static-symbols-leak.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Hack to check for leaking symbols in the static library.
|
||||||
|
# See https://bugs.freedesktop.org/show_bug.cgi?id=82785
|
||||||
|
# Note the spaces in the expressions! After the first grep, each line
|
||||||
|
# is " T symbol_name"
|
||||||
|
|
||||||
|
builddir="$1"
|
||||||
|
|
||||||
|
test -f "$builddir/test-static-link" || (echo "Unable to find test file" && exit 1)
|
||||||
|
nm --extern-only "$builddir/test-static-link" |
|
||||||
|
grep -o -e " T .*" | \
|
||||||
|
grep -v -e " main\$" \
|
||||||
|
-e " atexit" \
|
||||||
|
-e " mangle_path" \
|
||||||
|
-e " *gcov.*" \
|
||||||
|
-e " _.*" \
|
||||||
|
-e " libevdev_*" && \
|
||||||
|
echo "Leaking symbols found" && exit 1 || exit 0
|
||||||
Loading…
Add table
Reference in a new issue