Boost logo

Boost :

Subject: Re: [boost] Making lots of compile FAIL tests
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2015-06-18 09:53:09


> -----Original Message-----
> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Andrey Semashev
> Sent: 18 June 2015 10:22
> To: boost_at_[hidden]
> Subject: Re: [boost] Making lots of compile FAIL tests
>
> On Wed, Jun 17, 2015 at 5:57 PM, Paul A. Bristow <pbristow_at_[hidden]> wrote:
> > I've started to devise some tests to ensure that things that really
> > should not compile, do in fact compile-fail.
> >
> > So far I've produced a few files with a single statement that should fail inside a int main(){}.
> >
> > But it's looking at though it will get pretty tedious pretty soon :-(
> >
> > (I see for example that Boost.Multiprecision has some 50-ish
> > compile_fail items)
> >
> > Is there some slicker way of doing this?
>
> Depending on complexity of the checks you perform, you could try to auto-generate those tests from
> bjam. For example, in Boost.Log I'm generating compile tests for every public header (so that
there are no
> missing includes, syntax errors, etc.) using a single .cpp with a macro that expands to the tested
header
> name. See libs/log/test/Jamfile.v2, rule test_all and
libs/log/test/compile/self_contained_header.cpp.

That's rather neat, but I'm not sure that my tests are quite tedious enough to resort to such
serious grappling with bjam ;-)

Thanks

Paul


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