[gtk-doc] tests: also test xsl files for validity



commit 1dd9e44d1786fa6cc44ab3243ff94af8c7d15668
Author: Stefan Kost <ensonic users sf net>
Date:   Wed Dec 23 02:33:56 2009 +0200

    tests: also test xsl files for validity
    
    Rework the test for less copy and past also

 tests/Makefile.am |    6 +++
 tests/tools.sh.in |   91 ++++++++++++++++------------------------------------
 2 files changed, 34 insertions(+), 63 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 60d6448..d4c94ec 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,6 +6,7 @@ if BUILD_TESTS
 
 TESTS = tools.sh gobject.sh bugs.sh annotations.sh fail.sh
 TESTS_ENVIRONMENT = \
+	ABS_TOP_BUILDDIR=$(abs_top_builddir) \
 	PATH=$(abs_top_builddir):$(srcdir):$(PATH) \
 	PERL5LIB=$(abs_top_builddir):$(PERL5LIB)
 
@@ -14,5 +15,10 @@ endif
 EXTRA_DIST = gtkdoctest.sh tools.sh \
 	gobject.sh bugs.sh annotations.sh fail.sh
 
+# run any given test by running make <test>.check
+%.check: %
+	@$(TESTS_ENVIRONMENT)	\
+	./$*
+
 
 -include $(top_srcdir)/git.mk
diff --git a/tests/tools.sh.in b/tests/tools.sh.in
index f31c0cb..242adcf 100644
--- a/tests/tools.sh.in
+++ b/tests/tools.sh.in
@@ -5,76 +5,41 @@ tested=0
 
 echo "Running suite(s): gtk-doc-tools";
 
+# we can use which here as we override the path in TEST_ENVIRONMENT
 
 # test perl scripts
 
- PERL@ -cwT `which gtkdoc-check`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-fixxref`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-mkdb`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-mktmpl`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-rebase`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-scan`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-scangobj`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
-
- PERL@ -cwT `which gtkdoc-scanobj`
-if test $? = 1 ; then failed=$(($failed + 1)); fi
-tested=$(($tested + 1))
+for file in gtkdoc-check gtkdoc-fixxref gtkdoc-mkdb gtkdoc-mktmpl gtkdoc-rebase gtkdoc-scan gtkdoc-scangobj gtkdoc-scanobj ; do
+  @PERL@ -cwT `which $file`
+  if test $? = 1 ; then failed=$(($failed + 1)); fi
+  tested=$(($tested + 1))
+done
 
 
 # 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))
-
+for file in gtkdoc-mkhtml gtkdoc-mkman gtkdoc-mkpdf gtkdocize; do
+  sh -n `which $file`
+  if test $? != 0 ; then
+    failed=$(($failed + 1));
+  else
+    echo `which $file`" syntax OK";
+  fi
+  tested=$(($tested + 1))
+done
+
+
+# test xsl files
+
+for file in $ABS_TOP_BUILDDIR/*.xsl; do
+  xmllint --noout --noent $file
+  if test $? != 0 ; then
+    failed=$(($failed + 1));
+  else
+    echo "$file syntax OK";
+  fi
+  tested=$(($tested + 1))
+done
 
 # summary
 



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