Use sh
[vlc.git] / bindings / cil / tests / missing_api
1 #! /bin/sh
2 # Finds LibVLC API mismatch within the CIL bindings
3 # Copyright 2008 RĂ©mi Denis-Courmont
4
5 if test "${srcdir}" = ""; then
6         srcdir="$(dirname "$0")"
7 fi
8
9 libvlcsym="${srcdir}/../../../src/libvlc.sym"
10 if ! test -f "${libvlcsym}"; then
11         echo "Cannot find ${libvlcsym}\!" >&2
12         exit 77
13 fi
14
15 cat ${srcdir}/../src/*.cs | \
16 sed -n -e 's,^.*EntryPoint="\([^"]*\)".*$,\1,p' | {
17         cat
18         # Symbols we do not need:
19         echo 'libvlc_exception_raise'
20 } | \
21 sort -u | \
22 diff -u - "${libvlcsym}" | \
23 grep -ve '^+\(mediacontrol_\|libvlc_playlist_\)' | {
24         read line # ---
25         read line # +++
26         broken=no
27         while read line; do
28                 match="${line#+}"
29                 if test "${line}" != "${match}"; then
30                         echo "Unimplemented: $match"
31                         broken=yes
32                 fi
33
34                 match="${line#-}"
35                 if test "${line}" != "${match}"; then
36                         echo "Invalid:       $match"
37                         broken=yes
38                 fi
39         done
40         test "${broken}" = "no"
41 }