summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/005_attention.dox2
-rw-r--r--testing/031/indexpage.xml1
-rw-r--r--testing/031_image.dox1
-rw-r--r--testing/043_page.dox2
-rw-r--r--testing/051/indexpage.xml2
-rw-r--r--testing/051_escape.dox2
-rw-r--r--testing/README.txt14
-rw-r--r--testing/runtests.py126
8 files changed, 129 insertions, 21 deletions
diff --git a/testing/005_attention.dox b/testing/005_attention.dox
index c3c390e..90f67f5 100644
--- a/testing/005_attention.dox
+++ b/testing/005_attention.dox
@@ -1,4 +1,4 @@
-// objective: test \attention, \not, \remark, \warning, and \par commands
+// objective: test \attention, \note, \remark, \warning, and \par commands
// check: indexpage.xml
/** \mainpage
* \attention Attention message.
diff --git a/testing/031/indexpage.xml b/testing/031/indexpage.xml
index 3b3a2e3..2c1dfd7 100644
--- a/testing/031/indexpage.xml
+++ b/testing/031/indexpage.xml
@@ -8,6 +8,7 @@
<detaileddescription>
<para>Some text. <image type="html" name="sample.png"/>
<image type="latex" name="sample.png" width="5cm">Doxygen logo</image>
+ <image type="docbook" name="sample.png"/>
More text. </para>
</detaileddescription>
</compounddef>
diff --git a/testing/031_image.dox b/testing/031_image.dox
index f437086..8ba47b7 100644
--- a/testing/031_image.dox
+++ b/testing/031_image.dox
@@ -5,5 +5,6 @@
* Some text.
* \image html sample.png
* \image latex sample.png "Doxygen logo" width=5cm
+ * \image docbook sample.png
* More text.
*/
diff --git a/testing/043_page.dox b/testing/043_page.dox
index d554da2..9ac5c0e 100644
--- a/testing/043_page.dox
+++ b/testing/043_page.dox
@@ -4,7 +4,7 @@
/** \page mypage Page Title
* \brief Page brief description.
*
- * @tableofcontents{xml,html,latex}
+ * @tableofcontents{xml,html,latex,docbook}
*
* Text at page level. See \ref mysect for more.
* \section mysect Section Title.
diff --git a/testing/051/indexpage.xml b/testing/051/indexpage.xml
index 776f525..50a6ff8 100644
--- a/testing/051/indexpage.xml
+++ b/testing/051/indexpage.xml
@@ -6,7 +6,7 @@
<briefdescription>
</briefdescription>
<detaileddescription>
- <para>Dollar $ At @ Backslash \ Amphasand &amp; Less &lt; Greater &gt; Hash # Percent % Quote " Dot . Double colon :: Pipe | Plus + Minus - </para>
+ <para>Dollar $ At @ Backslash \ Ampersand &amp; Less &lt; Greater &gt; Hash # Percent % Quote " Dot . Double colon :: Pipe | Plus + Minus - </para>
</detaileddescription>
</compounddef>
</doxygen>
diff --git a/testing/051_escape.dox b/testing/051_escape.dox
index 290b298..2165564 100644
--- a/testing/051_escape.dox
+++ b/testing/051_escape.dox
@@ -5,7 +5,7 @@
Dollar \$
At \@
Backslash \\
-Amphasand \&
+Ampersand \&
Less \<
Greater \>
Hash \#
diff --git a/testing/README.txt b/testing/README.txt
index a5a0ad9..39b2345 100644
--- a/testing/README.txt
+++ b/testing/README.txt
@@ -1,4 +1,4 @@
-Doxygen regession test suite
+Doxygen regression test suite
============================
This directory contains a set of regression tests. Each test consists of a
@@ -7,7 +7,7 @@ has the same 3 digit number. The directory contains one or more reference
files that are compared against the XML output produced by doxygen. If the
result is the same, there is no regression and the test passes. If there is a
difference the test fails and the difference (in diff -u format) will be shown.
-It is also possible to see whether or not the test can be build to a xhtml set
+It is also possible to see whether or not the test can be built to a xhtml set
of files (and tested against a DTD), it is also possible to create a pdf file
for each test to see if the LaTeX / pdf generation is possible.
@@ -17,6 +17,8 @@ optional parameters:
--doxygen [DOXYGEN] path/name of the doxygen executable
--xmllint [XMLLINT] path/name of the xmllint executable
--id IDS [IDS ...] id of the test to perform
+ --start_id START_ID run tests starting with number n
+ --end_id END_ID run tests ending with number n
--all perform all tests
--inputdir [INPUTDIR]
input directory containing the tests
@@ -24,10 +26,15 @@ optional parameters:
output directory to write the doxygen output to
--noredir disable redirection of doxygen warnings
--xml create xml output and check
+ --rtf create rtf output
+ --docbook create docbook output and check with xmllint
--xhtml create xhtml output and check with xmllint
--pdf create LaTeX output and create pdf from it
+ --subdirs use the configuration parameter CREATE_SUBDIRS=YES
--keep keep result directories
-In case neither --xml, --pdf or --xhtml is used the default is set to --xml.
+ --cfg CFGS [CFGS ...] run test with extra doxygen configuration settings
+ (the option may be specified multiple times
+In case neither --xml, --pdf, --rtf, --docbook or --xhtml is used the default is set to --xml.
The runtest.pl has the following dependencies on 3rd party tools:
- python to run the script
@@ -57,4 +64,3 @@ There is also a CMakeLists.txt, which can be used from the build directory
to run all tests by simply invoking 'make tests', to use the specific options use
the flag TEST_FLAGS with make
e.g. make tests TEST_FLAGS="--id=5 --id=10 --pdf --xhtml"
-
diff --git a/testing/runtests.py b/testing/runtests.py
index 9330d23..452c36e 100644
--- a/testing/runtests.py
+++ b/testing/runtests.py
@@ -43,6 +43,28 @@ class Tester:
rtnmsg += o
return rtnmsg
+ def cleanup_xmllint_docbook(self,errmsg):
+ # For future work, first get everything valid XML
+ msg = self.cleanup_xmllint(errmsg).split('\n')
+ rtnmsg = ""
+ cnt = 0
+ for o in msg:
+ if (o):
+ if (cnt):
+ cnt -= 1
+ pass
+ elif (o.endswith("does not validate")):
+ pass
+ elif (o.find("no DTD found!")!=-1):
+ pass
+ elif (o.find("is not an NCName")!=-1):
+ cnt = 2
+ else:
+ if (rtnmsg):
+ rtnmsg += '\n'
+ rtnmsg += o
+ return rtnmsg
+
def get_config(self):
config = {}
with open(self.args.inputdir+'/'+self.test,'r') as f:
@@ -53,7 +75,7 @@ class Tester:
value = m.group('value')
if (key=='config'):
value = value.replace('$INPUTDIR',self.args.inputdir)
- #print('key=%s value=%s' % (key,value))
+ # print('key=%s value=%s' % (key,value))
config.setdefault(key, []).append(value)
return config
@@ -74,6 +96,16 @@ class Tester:
print('XML_OUTPUT=%s/out' % self.test_out, file=f)
else:
print('GENERATE_XML=NO', file=f)
+ if (self.args.rtf):
+ print('GENERATE_RTF=YES', file=f)
+ print('RTF_OUTPUT=%s/rtf' % self.test_out, file=f)
+ else:
+ print('GENERATE_RTF=NO', file=f)
+ if (self.args.docbook):
+ print('GENERATE_DOCBOOK=YES', file=f)
+ print('DOCBOOK_OUTPUT=%s/docbook' % self.test_out, file=f)
+ else:
+ print('GENERATE_DOCBOOK=NO', file=f)
if (self.args.xhtml):
print('GENERATE_HTML=YES', file=f)
# HTML_OUTPUT can also be set locally
@@ -82,6 +114,14 @@ class Tester:
if (self.args.pdf):
print('GENERATE_LATEX=YES', file=f)
print('LATEX_OUTPUT=%s/latex' % self.test_out, file=f)
+ if self.args.subdirs:
+ print('CREATE_SUBDIRS=YES', file=f)
+ if (self.args.cfgs):
+ for cfg in list(itertools.chain.from_iterable(self.args.cfgs)):
+ if cfg.find('=') == -1:
+ print("Not a doxygen configuration item, missing '=' sign: '%s'."%cfg)
+ sys.exit(1)
+ print(cfg, file=f)
if 'check' not in self.config or not self.config['check']:
print('Test doesn\'t specify any files to check')
@@ -97,7 +137,7 @@ class Tester:
redir=''
if os.system('%s %s/Doxyfile %s' % (self.args.doxygen,self.test_out,redir))!=0:
- print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out));
+ print('Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.test_out))
sys.exit(1)
# update the reference data for this test
@@ -140,6 +180,8 @@ class Tester:
failed_xml=False
failed_html=False
failed_latex=False
+ failed_docbook=False
+ failed_rtf=False
msg = ()
# look for files to check against the reference
if self.args.xml:
@@ -149,8 +191,14 @@ class Tester:
check_file='%s/out/%s' % (self.test_out,check)
# check if the file we need to check is actually generated
if not os.path.isfile(check_file):
- msg += ('Non-existing file %s after \'check:\' statement' % check_file,)
- break
+ # try with sub dirs
+ check_file = glob.glob('%s/out/*/*/%s' % (self.test_out,check))
+ if not check_file:
+ check_file='%s/out/%s' % (self.test_out,check)
+ msg += ('Non-existing file %s after \'check:\' statement' % check_file,)
+ break
+ else:
+ check_file = check_file[0]
# convert output to canonical form
data = os.popen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
if data:
@@ -171,6 +219,34 @@ class Tester:
xml_output='%s/out' % self.test_out
shutil.rmtree(xml_output,ignore_errors=True)
+ if (self.args.rtf):
+ # no tests defined yet
+ pass
+
+ if (self.args.docbook):
+ docbook_output='%s/docbook' % self.test_out
+ if (sys.platform == 'win32'):
+ redirx=' 2> %s/temp >nul:'%docbook_output
+ else:
+ redirx='2>%s/temp >/dev/null'%docbook_output
+ # For future work, first get everything valid XML
+ # exe_string = '%s --relaxng db/docbook.rng --nonet --postvalid %s/*xml %s % (self.args.xmllint,docbook_output,redirx)
+ tests = []
+ tests.append(glob.glob('%s/*.xml' % (docbook_output)))
+ tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
+ tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
+ exe_string = '%s --nonet --postvalid %s %s' % (self.args.xmllint,tests,redirx)
+ exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
+
+ failed_docbook=False
+ xmllint_out = os.popen(exe_string).read()
+ xmllint_out = self.cleanup_xmllint_docbook(xmllint_out)
+ if xmllint_out:
+ msg += (xmllint_out,)
+ failed_docbook=True
+ elif not self.args.keep:
+ shutil.rmtree(docbook_output,ignore_errors=True)
+
if (self.args.xhtml):
html_output='%s/html' % self.test_out
if (sys.platform == 'win32'):
@@ -206,7 +282,7 @@ class Tester:
elif not self.args.keep:
shutil.rmtree(latex_output,ignore_errors=True)
- if failed_xml or failed_html or failed_latex:
+ if failed_xml or failed_html or failed_latex or failed_docbook or failed_rtf:
testmgr.ok(False,self.test_name,msg)
return
@@ -268,14 +344,18 @@ def main():
parser = argparse.ArgumentParser(description='run doxygen tests')
parser.add_argument('--updateref',help=
'update the reference files. Should be used in combination with -id to '
- 'update the reference file(s) for the given test',action="store_true")
+ 'update the reference file(s) for the given test',action="store_true")
parser.add_argument('--doxygen',nargs='?',default='doxygen',help=
'path/name of the doxygen executable')
parser.add_argument('--xmllint',nargs='?',default='xmllint',help=
'path/name of the xmllint executable')
parser.add_argument('--id',nargs='+',dest='ids',action='append',type=int,help=
- 'run test with number n only (the option may be specified run test with '
- 'number n only (the option may be specified')
+ 'run test with number n only (the option can be specified to run test with '
+ 'number n only (the option can be specified multiple times')
+ parser.add_argument('--start_id',dest='start_id',type=int,help=
+ 'run tests starting with number n')
+ parser.add_argument('--end_id',dest='end_id',type=int,help=
+ 'run tests ending with number n')
parser.add_argument('--all',help=
'can be used in combination with -updateref to update the reference files '
'for all tests.',action="store_true")
@@ -287,17 +367,26 @@ def main():
'disable redirection of doxygen warnings',action="store_true")
parser.add_argument('--xml',help='create xml output and check',
action="store_true")
+ parser.add_argument('--rtf',help=
+ 'create rtf output',action="store_true")
+ parser.add_argument('--docbook',help=
+ 'create docbook output and check with xmllint',action="store_true")
parser.add_argument('--xhtml',help=
'create xhtml output and check with xmllint',action="store_true")
parser.add_argument('--pdf',help='create LaTeX output and create pdf from it',
action="store_true")
+ parser.add_argument('--subdirs',help='use the configuration parameter CREATE_SUBDIRS=YES',
+ action="store_true")
parser.add_argument('--keep',help='keep result directories',
action="store_true")
+ parser.add_argument('--cfg',nargs='+',dest='cfgs',action='append',help=
+ 'run test with extra doxygen configuration settings '
+ '(the option may be specified multiple times')
test_flags = os.getenv('TEST_FLAGS', default='').split()
args = parser.parse_args(test_flags + sys.argv[1:])
# sanity check
- if (not args.xml) and (not args.pdf) and (not args.xhtml):
+ if (not args.xml) and (not args.pdf) and (not args.xhtml) and (not args.docbook and (not args.rtf)):
args.xml=True
if (not args.updateref is None) and (args.ids is None) and (args.all is None):
parser.error('--updateref requires either --id or --all')
@@ -305,15 +394,26 @@ def main():
starting_directory = os.getcwd()
os.chdir(args.inputdir)
# find the tests to run
- if args.ids: # test ids are given by user
- tests = []
+ tests = []
+ if args.start_id:
+ if args.end_id:
+ for id in range(args.start_id, args.end_id + 1):
+ tests.append(glob.glob('%s_*'%id))
+ tests.append(glob.glob('0%s_*'%id))
+ tests.append(glob.glob('00%s_*'%id))
+ else:
+ parser.error('--start_id requires --end_id')
+ elif args.end_id:
+ parser.error('--end_id requires --start_id')
+ if args.ids: # test ids are given by user
for id in list(itertools.chain.from_iterable(args.ids)):
tests.append(glob.glob('%s_*'%id))
tests.append(glob.glob('0%s_*'%id))
tests.append(glob.glob('00%s_*'%id))
- tests = list(itertools.chain.from_iterable(tests))
- else: # find all tests
+ if (not args.ids and not args.start_id): # find all tests
tests = glob.glob('[0-9][0-9][0-9]_*')
+ else:
+ tests = list(itertools.chain.from_iterable(tests))
os.chdir(starting_directory)
# create test manager to run the tests