[gobject-introspection] tests: Ignore platform-dependent field in test results
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] tests: Ignore platform-dependent field in test results
- Date: Wed, 28 Mar 2018 10:40:59 +0000 (UTC)
commit 2a03a8d9fa58d2975406d1421a8a66436419fc71
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Nov 15 21:07:47 2015 -0500
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.
tests/gi-tester | 9 +++++++--
1 file 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]