diff --git a/meson.build b/meson.build index f135d4a7..9b409691 100644 --- a/meson.build +++ b/meson.build @@ -726,10 +726,9 @@ test('tools-builddir-lookup-installed', ############ tests ############ -test_symbols_leak = find_program('test/symbols-leak-test.in') test('symbols-leak-test', - test_symbols_leak, - args : [ meson.current_source_dir() ]) + find_program('test/symbols-leak-test'), + args : [ join_paths(dir_src, 'libinput.sym'), dir_src]) # build-test only executable('test-build-pedantic', diff --git a/test/symbols-leak-test b/test/symbols-leak-test new file mode 100755 index 00000000..7b612f41 --- /dev/null +++ b/test/symbols-leak-test @@ -0,0 +1,18 @@ +#!/bin/bash -e +# +# simple check for exported symbols +# +# Usage: symbols-leak-test /path/to/mapfile /path/to/libinput/src + +mapfile="$1" +shift +srcdir="$1" +shift + +diff -a -u \ + <(cat "$mapfile" | \ + grep '^\s\+libinput_.*' | \ + sed -e 's/^\s\+\(.*\);/\1/' | sort) \ + <(cat "$srcdir"/*.c | \ + grep LIBINPUT_EXPORT -A 1 | grep '^libinput_.*' | \ + sed -e 's/(.*//' | sort) diff --git a/test/symbols-leak-test.in b/test/symbols-leak-test.in deleted file mode 100755 index 86792dc5..00000000 --- a/test/symbols-leak-test.in +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -### simple check for exported symbols - -# Allow running this after the configure.ac replacement or directly with an -# argument for the top_srcdir -TOP_SRCDIR="@top_srcdir@" -case "$TOP_SRCDIR" in -@*) - TOP_SRCDIR="$1" - ;; -*) - ;; -esac - -# make bash exit if any command will exit with non-0 return value -set -e - -# make sure the paths are alright -cd `dirname $0` - -diff -a -u \ - <(cat "$TOP_SRCDIR"/src/libinput.sym | \ - grep '^\s\+libinput_.*' | \ - sed -e 's/^\s\+\(.*\);/\1/' | sort) \ - <(cat "$TOP_SRCDIR"/src/*.c | \ - grep LIBINPUT_EXPORT -A 1 | grep '^libinput_.*' | \ - sed -e 's/(.*//' | sort)