]> git.sesse.net Git - vlc/commitdiff
CIL API sanity checks (well known to fail at the moment)
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 27 May 2008 17:26:46 +0000 (20:26 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 27 May 2008 17:26:46 +0000 (20:26 +0300)
bindings/cil/tests/Makefile.am
bindings/cil/tests/missing_api [new file with mode: 0755]

index ab08d7b94340e98cfb1d0d81f8210db37b3a5078..116102de6d269b265ae643d1b6d0482a0603fcc0 100644 (file)
@@ -1,7 +1,8 @@
 EXTRA_DIST = $(SOURCES_testvlc)
 MOSTLYCLEANFILES = $(check_SCRIPTS)
 
-check_SCRIPTS = testvlc.exe
+noinst_SCRIPTS = testvlc.exe
+dist_check_SCRIPTS = missing_api
 
 SOURCES_testvlc = testvlc.cs
 LDADD_testvlc = -lib:../src -r:VideoLAN.LibVLC.dll
@@ -9,3 +10,4 @@ LDADD_testvlc = -lib:../src -r:VideoLAN.LibVLC.dll
 testvlc.exe: $(SOURCES_testvlc)
        $(CSC) -target:exe -out:$@ $(CSFLAGS) $^ $(LDADD_testvlc)
 
+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"
+}