diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-02-18 19:21:47 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-02-19 08:34:55 +1000 |
commit | d654a8edf8070e21c1634809a4108e663eb4a16d (patch) | |
tree | 631562c6dd110f1298ca371b1e786e6b52c9ab08 /test | |
parent | cd9fd458a58ea0b43257c2bb6f2470013460a8d4 (diff) |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 22 | ||||
-rwxr-xr-x | test/test-static-symbols-leak.sh | 19 |
2 files changed, 23 insertions, 18 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 4e92375..5f0c008 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -130,28 +130,14 @@ endif # GCOV_ENABLED endif # ENABLE_RUNTIME_TESTS if ENABLE_STATIC_SYMBOL_LEAKS_TEST -# 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" -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 \ - ) +static-symbol-leaks: test-static-link test-static-symbols-leak.sh + $(AM_V_GEN) $(srcdir)/test-static-symbols-leak.sh $(builddir) check_local_deps += static-symbol-leaks + 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) diff --git a/test/test-static-symbols-leak.sh b/test/test-static-symbols-leak.sh new file mode 100755 index 0000000..74ff3b9 --- /dev/null +++ b/test/test-static-symbols-leak.sh @@ -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 |