|
Boost : |
Subject: Re: [boost] [BoostBook] how to automatically test code examples?
From: Robert Ramey (ramey_at_[hidden])
Date: 2017-10-19 14:24:22
On 10/19/17 3:03 AM, Hans Dembinski via Boost wrote:
> Dear Daniel,
>
>> On 19. Oct 2017, at 11:43, Daniel James via Boost <boost_at_[hidden]> wrote:
>>> I didn't get any reply so far⦠was my question stupid? Or is it simply that no one knows? Is the author of BoostBook, Douglas Gregor, not around anymore?
>>
>> Sorry, I was looking into this but a power cut got in the way. It
>> looks like the xsl script at tools/boostbook/xsl/testing/Jamfile.xsl
>> will generate a jamfile and test cases from tests marked up in xml,
>> and you can find the xml schema details in the boostbook reference
>> documentation. There doesn't seem to be any support for running this
>> from boost build though.
>
> thank you for looking into this :) I am still confused how to use this, though. I guess I will stick to my poor-mans cmake/python-based solution for now.
Here's the way I handle this:
I make up my examples in the "example" directory. This includes a
Jamfile to build and run the examples.
I create the BoostBook xml using and XMLmind - an xml editor. Within
that environment I just use an "Include" directive to include the source
code of the example in the correct place - easy as pie. If you download
the slides associated with my recent CPPCon presentation, you can see
how it's done.
https://www.youtube.com/watch?v=YxmdCxX9dMk
you can download the slides and example here:
Robert Ramey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk