Boost logo

Boost :

Subject: Re: [boost] [BoostBook] how to automatically test code examples?
From: Daniel James (dnljms_at_[hidden])
Date: 2017-10-19 10:50:05


mOn 19 October 2017 at 11:03, Hans Dembinski via Boost
<boost_at_[hidden]> 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.

For what it's worth, I tried creating an example that uses it. It's at:

https://github.com/danieljames/boostbook-test-example

If anyone actually wants to try it out, they'll need to clone it into
their boost tree. But I included all the generated files, so can just
look at them. The generated test doesn't actually work as it was
written for boost build v1, so boostbook would need to be updated. It
doesn't seem that useful to me, writing tests in xml would be a pain
and less flexible than doing it normally, and the generated
documentation doesn't seem useful - although what I wrote was pretty
minimal, maybe with a bit more information it would be better?

The boostbook file containing the test is at:

https://github.com/danieljames/boostbook-test-example/blob/master/doc/tests.xml

The script to generate the test is at:

https://github.com/danieljames/boostbook-test-example/blob/master/doc/generate-tests.sh

The generated test code is at:

https://github.com/danieljames/boostbook-test-example/tree/master/test


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk