Re: Fortran code test suite

Oleg Batrashev <[email protected]>
Newsgroups gmane.text.doxygen.devel
Message-ID <[email protected]>
Hi,

> I found there is an xml output from Doxygen. Has anyone tried to write
> regression tests based on it, using XPath or any similar technique?
> It seems to be good tool to verify parsers.
I've made a try and quite satisfied by now.
https://github.com/ogbash/doxygen-tests

Currently there are only 8 tests, where 5 are taken from bug reports.
Release-1.7.1 gives 7 failures.
Release-1.7.3-20110217 gives 3 failures out of 8 tests.

runTest (tests.blocks.interface_abst_f90) ... ok
runTest (tests.blocks.interface_gen_f90) ... ok
runTest (tests.blocks.interface_op_f90) ... ok
runTest (tests.blocks.interface_spec_f90) ... ok
runTest (tests.syntax.label_endsub) ... ok
runTest (tests.linecont.parcomment_f) ... FAIL
runTest (tests.linecont.parcomment_f90) ... FAIL
runTest (tests.linecont.varcomment_f90) ... FAIL

89e2c4 from https://github.com/ogbash/doxygen-f90 gives no errors.

Writing tests is not trivial but managable after making yourself
familiar to XPath syntax.
For example, testing that 'example' subroutine exists in
'parcomment.f' file and its 'val' parameter is documented:

        file = self.getFile("parcomment.f")
        example = self.getSubprogram(file, "example")

        desc = self.getParamDescription(example, "val")
        self.assertEqual(desc.getContent().strip(), "[in] scalar double input")

Testing type of the variable 'as' with XPath:

        var = self.getModuleVariable(varcomment, "as")
        self.assertEqual(var.xpathEval("type")[0].getContent().strip(),
                         "integer, dimension(:,:), pointer")


Any suggestions, comments, or even new tests are welcome,
Oleg

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.