From 6b73d93ca44e263716d0644e3d947a4793c8c82c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 12 Jul 2018 08:42:53 +1000 Subject: [PATCH] test: tidy up the symbols leak test This hasn't been a real .in file since the autotools removal, so rename it to reflect that. And since we can call it with arguments from meson, let's do so in the most sensible manner - passing the full paths in as required rather than relying on a directory layout within the script. Signed-off-by: Peter Hutterer --- meson.build | 5 ++--- test/symbols-leak-test | 18 ++++++++++++++++++ test/symbols-leak-test.in | 28 ---------------------------- 3 files changed, 20 insertions(+), 31 deletions(-) create mode 100755 test/symbols-leak-test delete mode 100755 test/symbols-leak-test.in 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)