summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2015-11-15 21:07:47 -0500
committerPhilip Chimento <philip.chimento@gmail.com>2018-03-27 21:06:27 -0700
commit2a03a8d9fa58d2975406d1421a8a66436419fc71 (patch)
tree2e0d128352dac78e351e8653505ddfd519a1684c /tests
parente69fa1a1a9c839b16e9a807ba82cd792302a3dfa (diff)
downloadgobject-introspection-2a03a8d9fa58d2975406d1421a8a66436419fc71.tar.gz
tests: Ignore platform-dependent field in test results
The "shared-library" field of the GIR is platform-dependent, since shared libraries have different names on different platforms. For example, on OS X, the field refers to a .dylib rather than a .so. We ignore this field when comparing the expected output with the generated output. See #139.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/gi-tester9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/gi-tester b/tests/gi-tester
index 26e22591..80f2edb0 100755
--- a/tests/gi-tester
+++ b/tests/gi-tester
@@ -7,11 +7,16 @@ targetname=$1
# in directory diffs.
targetbase=${targetname##*/}
+# The "shared-library" field of the GIR is platform-dependent. For example, on
+# OSX, shared libraries have the extension .dylib. Ignore this field when
+# determining whether the output succeeded.
+ignore_expr='-I shared-library=".*"$'
+
case $targetname in
*.gir)
len=${#targetname}
limit=$(expr $len - 4)
- diff -u -U 10 ${srcdir}/${targetname:0:${limit}}-expected.gir ${builddir}/${targetname}
+ diff -u -U 10 ${ignore_expr} ${srcdir}/${targetname:0:${limit}}-expected.gir ${builddir}/${targetname}
exit $?
;;
*.typelib)
@@ -31,7 +36,7 @@ case $targetname in
exit $?
;;
*-sections.txt)
- diff -u -w -I '^\s*$' -U 10 ${srcdir}/${targetname::-4}-expected.txt ${builddir}/${targetname}
+ diff -u -w -I '^\s*$' -U 10 ${srcdir}/${targetname::$((${#targetname} - 4))}-expected.txt ${builddir}/${targetname}
exit $?
;;
*.py)