• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2set -eu
3
4RET=0
5LIB=${WAYLAND_EGL_LIB}
6
7if ! test -f "$LIB"; then
8	echo "Test binary \"$LIB\" does not exist"
9	exit 99
10fi
11
12if ! test -n "$NM"; then
13	echo "nm environment variable not set"
14	exit 99
15fi
16
17AVAIL_FUNCS="$($NM -D --format=bsd --defined-only $LIB | awk '{print $3}')"
18
19# Official ABI, taken from the header.
20REQ_FUNCS="wl_egl_window_resize
21wl_egl_window_create
22wl_egl_window_destroy
23wl_egl_window_get_attached_size
24"
25
26NEW_ABI=$(echo "$AVAIL_FUNCS" | while read func; do
27    echo "$func" | grep -q "^_" && continue
28    echo "$REQ_FUNCS" | grep -q "^$func$" && continue
29
30    echo $func
31done)
32
33if test -n "$NEW_ABI"; then
34	echo "New ABI detected - If intentional, update the test."
35	echo "$NEW_ABI"
36	RET=1
37fi
38
39REMOVED_ABI=$(echo "$REQ_FUNCS" | while read func; do
40    echo "$AVAIL_FUNCS" | grep -q "^$func$" && continue
41
42    echo $func
43done)
44
45if test -n "$REMOVED_ABI"; then
46	echo "ABI break detected - Required symbol(s) no longer exported!"
47	echo "$REMOVED_ABI"
48	RET=1
49fi
50
51exit $RET
52