Hi all,

Regarding: doxygen v1.8.4 and C++ code.

I use BOOST's BOOST_PP_OVERLOAD macro to allow me to overload
some macro names.  In particular I have some macros for
assembling test cases.  So, for example, I might have:

/*! documentation */
TEST_CASE(test1) { ...code... }

/*! documentation */
TEST_CASE(test2, MyType) { ...code... }

/*! documentation */
TEST_CASE(test3, MyType, "A description") { ...code ... }


As a practical matter this works quite well, and inside my test
documentation I found I can use \relatesalso to get my tests
attached to the relevant classes, which is sort of neat.  As
they are now they show up as links to related functions like:
    TEST_CASE(test1)
    TEST_CASE(test2, MyType)
    TEST_CASE(test3, MyType, "A description")

However.  What I also wanted to do was inside the documentation
for each method and function being tested, was put an explicit
link to the test case(s) that exercise it.  This will allow me
to review, in the documentation, which items have not yet been
covered by suitable testing.

The problem is that every test case is identified as TEST_CASE
rather than by name (test1, test2, test3) and that makes it
more difficult to set up simple \ref links.

So I thought to expand TEST_CASE inside doxygen so that the
three items above would look like this:
    test1()
    test2(MyType)
    test3(MyType, "A description")

And then I can easily link to test1 or test2 etc (there are
namespaces involved, but left out to keep my examples short).
A simple enough matter it would seem, but I can't seem to get
doxygen's preprocessor to do it.

Using EXPAND_AS_DEFINED to include TEST_CASE (and then setting
up a doxygen specific version of the overload to produce a
simple function-like declaration) expands out to
BOOST_PP_OVERLOAD.  I really don't want to expand all macros,
and can't see a way to easily expand just the boost ones that
I want.

One obvious solution is to stop using BOOST_PP_OVERLOAD and
just use the explicit subordinate macros you have to define as
part of using it - but I was hoping to avoid that.

So then I tried explicitly defined macros in PREDEFINED (with
MACRO_EXPANSION and EXPAND_ONLY_PREDEF turned on, of course).

It will even let me define the three different overloads in
the list:
    TEST_CASE(m1)=m1() \
    TEST_CASE(m1,m2)=m1(m2) \
    TEST_CASE(m1,m2,m3)=m1(m2, m3)

But it only ever expands one of them - the first I think.  It
seems to me that doxygen already has the smarts to identify a
macro both by name and the number of parameters (since the
versions of the macros it does not expand it leaves untouched
in the code), but it's not yet enough to actually expand
overloaded variations.

Does anyone know a way around this?

Is it worth adding this as a feature request?

-- 
Geoff Worboys
Telesis Computing Pty Ltd


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Doxygen-users mailing list
Doxygen-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/doxygen-users

Reply via email to