[gtk-doc] tests: run sanity.sh from the actual integration tests



commit 005b7c770e935259a2aee5a37e0f9ba619e548d7
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon May 7 18:53:57 2018 +0200

    tests: run sanity.sh from the actual integration tests
    
    This way we only run this if gtkdoctest passes.

 tests/Makefile.am    |    7 +++++--
 tests/annotations.sh |    4 +++-
 tests/bugs.sh        |    4 +++-
 tests/empty.sh       |    4 +++-
 tests/gobject.sh     |    4 +++-
 tests/program.sh     |    4 +++-
 tests/sanity.sh      |   24 ++++++++++--------------
 7 files changed, 30 insertions(+), 21 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ba88529..c1d35af 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,8 +4,9 @@ if BUILD_TESTS
 
 TESTS = \
   check.py common.py mk_to_db.py mkhtml2.py \
-  tools.sh gobject.sh bugs.sh annotations.sh fail.sh empty.sh program.sh \
-  sanity.sh
+  tools.sh \
+  annotations.sh bugs.sh empty.sh fail.sh gobject.sh program.sh
+
 TESTS_ENVIRONMENT = \
        BUILDDIR=$(abs_builddir) \
        SRCDIR=$(abs_srcdir) \
@@ -14,8 +15,10 @@ TESTS_ENVIRONMENT = \
        PATH=$(abs_top_builddir):$(srcdir):$(PATH) \
        PYTHONPATH=$(abs_top_builddir):$(abs_top_srcdir):$(PYTHONPATH) \
        GLIB_PREFIX="$(glib_prefix)"
+
 TEST_EXTENSIONS = .py
 PY_LOG_COMPILER = $(PYTHON)
+
 endif
 
 EXTRA_DIST = gtkdoctest.sh $(TESTS)
diff --git a/tests/annotations.sh b/tests/annotations.sh
index c2cdc48..1b9c724 100755
--- a/tests/annotations.sh
+++ b/tests/annotations.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
 
-gtkdoctest.sh annotations
+set -e
 
+gtkdoctest.sh annotations
+sanity.sh annotations
diff --git a/tests/bugs.sh b/tests/bugs.sh
index 6cfef4c..3b49af5 100755
--- a/tests/bugs.sh
+++ b/tests/bugs.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
 
-gtkdoctest.sh bugs
+set -e
 
+gtkdoctest.sh bugs
+sanity.sh bugs
diff --git a/tests/empty.sh b/tests/empty.sh
index b4e824a..c929fff 100755
--- a/tests/empty.sh
+++ b/tests/empty.sh
@@ -1,9 +1,11 @@
 #!/bin/sh
 
+set -e
+
 if ! grep -q ^GtkDocTestIf$ empty/docs/tester-sections.txt; then
     echo "Test for bug https://bugzilla.gnome.org/show_bug.cgi?id=705633 has failed."
     exit 1
 fi
 
 gtkdoctest.sh empty
-
+sanity.sh empty
diff --git a/tests/gobject.sh b/tests/gobject.sh
index 2983140..97cf356 100755
--- a/tests/gobject.sh
+++ b/tests/gobject.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
 
-gtkdoctest.sh gobject
+set -e
 
+gtkdoctest.sh gobject
+sanity.sh gobject
diff --git a/tests/program.sh b/tests/program.sh
index eb5d511..4f44eae 100755
--- a/tests/program.sh
+++ b/tests/program.sh
@@ -1,4 +1,6 @@
 #!/bin/sh
 
-gtkdoctest.sh program
+set -e
 
+gtkdoctest.sh program
+sanity.sh program
diff --git a/tests/sanity.sh b/tests/sanity.sh
index 5a79f18..f35c7bb 100755
--- a/tests/sanity.sh
+++ b/tests/sanity.sh
@@ -1,17 +1,16 @@
 #!/bin/sh
 
+suite=$1
 dir=$BUILDDIR
-#`dirname $0`
-suite="sanity"
 
 failed=0
 tested=0
 
-echo "Running suite(s): gtk-doc-$suite";
+echo "Running suite(s): gtk-doc-sanity $suite";
 
 # check the presence and non-emptyness of certain files
 nok=0
-for path in $dir/*/docs/html; do
+for path in $dir/$suite/docs/html; do
   if test ! -s $path/index.html ; then
     echo 1>&2 "no or empty $path/index.html"
     nok=`expr $nok + 1`; break;
@@ -29,9 +28,9 @@ done
 if test $nok -gt 0 ; then failed=`expr $failed + 1`; fi
 tested=`expr $tested + 1`
 
-# TODO: if we have pdf support check for ./tests/*/docs/tester.pdf
+# TODO: if we have pdf support check for ./tests/$suite/docs/tester.pdf
 nok=0
-for path in $dir/*/docs; do
+for path in $dir/$suite/docs; do
   if test ! -s $path/tester.pdf ; then
     if test -s $path/gtkdoc-mkpdf.log; then
       if ! grep >/dev/null 2>&1 "must be installed to use gtkdoc-mkpdf" $path/gtkdoc-mkpdf.log; then
@@ -46,7 +45,7 @@ tested=`expr $tested + 1`
 
 # check validity of generated xml files
 nok=0
-for file in $dir/*/docs/xml/*.xml; do
+for file in $dir/$suite/docs/xml/*.xml; do
   xmllint --noout --noent $file
   if test $? != 0 ; then
     echo 1>&2 "xml validity check failed for $file"
@@ -59,7 +58,7 @@ tested=`expr $tested + 1`
 
 # check validity of generated sgml files
 nok=0
-for file in $dir/*/docs/xml/*.sgml; do
+for file in $dir/$suite/docs/xml/*.sgml; do
   xmllint --noout --noent $file
   if test $? != 0 ; then
     echo 1>&2 "sgml validity check failed for $file"
@@ -71,7 +70,7 @@ tested=`expr $tested + 1`
 
 # check validity of devhelp2 files
 nok=0
-for file in $dir/*/docs/html/*.devhelp2; do
+for file in $dir/$suite/docs/html/*.devhelp2; do
   xmllint --noout --nonet --schema $ABS_TOP_SRCDIR/devhelp2.xsd $file
   if test $? != 0 ; then
     echo 1>&2 "devhelp2 xml validity check failed for $file"
@@ -88,7 +87,7 @@ DISCARD_PATTERN='Please fix https://bugs.launchpad.net/ubuntu/+source/gtk-doc/+b
 gunzip .*.gz
 
 '
-for file in $dir/*/docs/gtkdoc-*.log; do
+for file in $dir/$suite/docs/gtkdoc-*.log; do
   # skip this in verbose mode as we'll have more text
   if test "x${V}" = "x1"; then
     continue
@@ -96,9 +95,6 @@ for file in $dir/*/docs/gtkdoc-*.log; do
 
   expected_lines="1"
   # adjust for known files
-  if test $file = "$dir/fail/docs/gtkdoc-mkdb.log"; then
-    expected_lines="16"
-  fi
   if test $file = "$dir/bugs/docs/gtkdoc-mkdb.log"; then
     expected_lines="2"
   fi
@@ -125,7 +121,7 @@ tested=`expr $tested + 1`
 
 # check stability of generated xml/html
 nok=0
-for path in $dir/*/docs*; do
+for path in $dir/$suite/docs*; do
   if test -d $path/xml.ref; then
     diff -u $path/xml.ref $path/xml
     if test $? = 1 ; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]