3

Is there any way to use documentary comments for test-cases defined using Boost.Test macros ? Can I use Doxygen-styled comments, will they be parsed correctly?

Marc Andreson
  • 3,405
  • 5
  • 35
  • 51
  • 1
    According the the doxygen [preprocessing documentation](http://www.stack.nl/~dimitri/doxygen/preprocessing.html) it should be possible to document these tests with normal doxygen-style comments, but you will probably have to spend a bit of time playing with the `predefined` flag in your configuration file. See the `IUnknown` class example, about halfway down on [this](http://www.stack.nl/~dimitri/doxygen/preprocessing.html) page. – Chris Mar 13 '12 at 08:17

1 Answers1

2

The answer is to make your test cases so simple, so obvious and so readable that any documentation you write is superfluous. See the section titled Test Case Maintenance and Design in my rewrite of the Boost.Test docs.

legalize
  • 2,214
  • 18
  • 25
  • Yeah, well, this goes without saying, but I think it would be nice to have a list of all test cases attached to the class in test, so the documentation shows that and what is tested. – Rene Oct 27 '15 at 16:38
  • This adds an additional maintenance burden that isn't justified IMO. It's already the case that actual comments diverge from the code. The trend in software engineering has been to [express ideas directly in code](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rp-direct) instead of relying on comments or additional metadata on the code. – legalize Oct 27 '15 at 20:37