[gtk-doc] tests: cover shell scripts by unit tests, fixes #604998



commit 4dd5ee1d32332236cc1b9a2f4bde86bdb94fa8e4
Author: Stefan Kost <ensonic users sf net>
Date:   Sat Dec 19 22:01:20 2009 +0200

    tests: cover shell scripts by unit tests, fixes #604998
    
    Use sh -n to test the validity of the shellscripts we ship.

 tests/tools.sh.in |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/tests/tools.sh.in b/tests/tools.sh.in
index 7a866b7..f31c0cb 100644
--- a/tests/tools.sh.in
+++ b/tests/tools.sh.in
@@ -5,7 +5,8 @@ tested=0
 
 echo "Running suite(s): gtk-doc-tools";
 
-# tests
+
+# test perl scripts
 
 @PERL@ -cwT `which gtkdoc-check`
 if test $? = 1 ; then failed=$(($failed + 1)); fi
@@ -39,7 +40,44 @@ tested=$(($tested + 1))
 if test $? = 1 ; then failed=$(($failed + 1)); fi
 tested=$(($tested + 1))
 
+
+# test shell scripts
+
+sh -n `which gtkdoc-mkhtml`
+if test $? != 0 ; then
+  failed=$(($failed + 1));
+else
+  echo `which gtkdoc-mkhtml` "syntax OK";
+fi
+tested=$(($tested + 1))
+
+sh -n `which gtkdoc-mkman`
+if test $? != 0 ; then
+  failed=$(($failed + 1));
+else
+  echo `which gtkdoc-mkman` "syntax OK";
+fi
+tested=$(($tested + 1))
+
+sh -n `which gtkdoc-mkpdf`
+if test $? != 0 ; then
+  failed=$(($failed + 1));
+else
+  echo `which gtkdoc-mkpdf` "syntax OK";
+fi
+tested=$(($tested + 1))
+
+sh -n `which gtkdocize`
+if test $? != 0 ; then
+  failed=$(($failed + 1));
+else
+  echo `which gtkdocize` "syntax OK";
+fi
+tested=$(($tested + 1))
+
+
 # summary
+
 rate=$((100*($tested - $failed)/$tested));
 echo "$rate %: Checks $tested, Failures: $failed"
 exit `test $failed = 0`;



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