[xml] xmllint for unit testing



hi all,

a simple but effective suggestion for all who have xml files part of their
projects and using the auto-tools.

1.) make directory 'tests' (if there is not yet alreay one) and enter it
2.) write a Makefile.am containing :
TESTS = xmlvalid.sh
3.) wite xmlvalid.sh containg :
#!/bin/sh
# test validity of xml files

xmllint --noout --valid ../<path_to_xml_files>/*.xml
if [ $? -ne 0 ]; then exit 1; fi

4.) go back to yout project root and type :
make check

when having files without a dtd, just leave out the '--valid' to do
well-formed-ness checking at least.

Ciao
  Stefan
-- 
      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 301166
|      ///           04277 Leipzig      04251 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail    st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de
|           WWW      www.sonicpulse.de  www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - -  -    -




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