libinput/test/symbols-leak-test

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
505 B
Text
Raw Permalink Normal View History

#!/bin/bash
#
# simple check for exported symbols
#
# Usage: symbols-leak-test /path/to/mapfile /path/to/libinput/src
mapfile="$1"
shift
srcdir="$1"
shift
if [[ -z "$mapfile" || -z "$srcdir" ]]; then
echo "Usage: symbols-leak-test /path/to/mapfile /path/to/libinput/src"
exit 2
fi
set -e
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)