Re: [Doxygen-develop] Fortran code test suite
Brought to you by:
dimitri
From: Oleg B. <og...@gm...> - 2011-03-14 18:13:04
|
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 |