]> git.sesse.net Git - vlc/blobdiff - bindings/cil/tests/missing_api
CIL API sanity checks (well known to fail at the moment)
[vlc] / bindings / cil / tests / missing_api
diff --git a/bindings/cil/tests/missing_api b/bindings/cil/tests/missing_api
new file mode 100755 (executable)
index 0000000..ca9b858
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/dash
+# Finds LibVLC API mismatch within the CIL bindings
+# Copyright 2008 RĂ©mi Denis-Courmont
+
+if test "${srcdir}" = ""; then
+       srcdir="$(dirname "$0")"
+fi
+
+libvlcsym="${srcdir}/../../../src/libvlc.sym"
+if ! test -f "${libvlcsym}"; then
+       echo "Cannot find ${libvlcsym}\!" >&2
+       exit 77
+fi
+
+cat ${srcdir}/../src/*.cs | \
+sed -n -e 's,^.*EntryPoint="\([^"]*\)".*$,\1,p' | {
+       cat
+       # Symbols we do not need:
+       echo 'libvlc_exception_raise'
+} | \
+sort -u | \
+diff -u - "${libvlcsym}" | \
+grep -ve '^+\(mediacontrol_\|libvlc_playlist_\)' | {
+       read line # ---
+       read line # +++
+       broken=no
+       while read line; do
+               match="${line#+}"
+               if test "${line}" != "${match}"; then
+                       echo "Unimplemented: $match"
+                       broken=yes
+               fi
+
+               match="${line#-}"
+               if test "${line}" != "${match}"; then
+                       echo "Invalid:       $match"
+                       broken=yes
+               fi
+       done
+       test "${broken}" = "no"
+}