summaryrefslogtreecommitdiff
path: root/tests/gi-tester
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2013-12-20 03:38:37 -0800
committerColin Walters <walters@verbum.org>2013-12-29 18:54:21 +0000
commit3160f642dbed35b4af8e4d9314c60e4a037884c8 (patch)
tree2518768b956953f7635edee5380c7207b2137d24 /tests/gi-tester
parentce190a6bd3e6f4443eb346745807695aaebe907d (diff)
downloadgobject-introspection-3160f642dbed35b4af8e4d9314c60e4a037884c8.tar.gz
tests: Use Automake test harness for scanner diff tests
Add gi-tester script for dispatching various scanner diff tests based on their target suffix. Hook the dispatcher script into the Automake test harness which is passed the diff test target name. Remove usage of check-local which is always run regardless of whether or not the TESTS variable is set from the command line. This allows for both the ability to use the harnesses XFAIL_TESTS variable for expected failures as well as testing of targets individually, for example: cd tests/scanner make check TESTS=GtkFrob-1.0.gir make check TESTS=Regress-1.0-Python Add Headeronly-1.0-expected.gir for validating the results of the header only gir creation test. https://bugzilla.gnome.org/show_bug.cgi?id=720713
Diffstat (limited to 'tests/gi-tester')
-rwxr-xr-xtests/gi-tester39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/gi-tester b/tests/gi-tester
new file mode 100755
index 00000000..496b947b
--- /dev/null
+++ b/tests/gi-tester
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+targetname=$1
+
+# Note the target name for the documentation targets (-C, -Python, -Gjs)
+# incorrectly include a relative path to the srcdir, strip that off for usage
+# in directory diffs.
+targetbase=${targetname##*/}
+
+case $targetname in
+*.gir)
+ diff -u -U 10 ${srcdir}/${targetname::-4}-expected.gir ${builddir}/${targetname}
+ exit $?
+ ;;
+*.typelib)
+ # Do nothing for typelibs, this just ensures they build as part of the tests
+ exit 0
+ ;;
+*-C)
+ diff -r -u -w -B -U 10 ${srcdir}/${targetbase}-expected ${builddir}/${targetbase}
+ exit $?
+ ;;
+*-Python)
+ diff -r -u -w -B -U 10 ${srcdir}/${targetbase}-expected ${builddir}/${targetbase}
+ exit $?
+ ;;
+*-Gjs)
+ diff -r -u -w -B -U 10 ${srcdir}/${targetbase}-expected ${builddir}/${targetbase}
+ exit $?
+ ;;
+*-sections.txt)
+ diff -u -w -B -U 10 ${srcdir}/${targetname::-4}-expected.txt ${builddir}/${targetname}
+ exit $?
+ ;;
+*)
+ echo $"Usage: gi-tester <targetname>"
+ exit 1
+ ;;
+esac