summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2018-07-12 08:42:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2018-07-12 11:09:00 +1000
commit6b73d93ca44e263716d0644e3d947a4793c8c82c (patch)
treedb7f86aec6b654fe89af7dffb6cce76297dedad6
parentfa66edcd7394591f2cf8d2c3505f686366861832 (diff)
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 <peter.hutterer@who-t.net>
-rw-r--r--meson.build5
-rwxr-xr-xtest/symbols-leak-test18
-rwxr-xr-xtest/symbols-leak-test.in28
3 files changed, 20 insertions, 31 deletions
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)