-----Original Message----- From: Boost [mailto:boost-bounces@lists.boost.org] On Behalf Of Andrey Semashev Sent: 18 June 2015 10:22 To: boost@lists.boost.org Subject: Re: [boost] Making lots of compile FAIL tests
On Wed, Jun 17, 2015 at 5:57 PM, Paul A. Bristow
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
missing includes, syntax errors, etc.) using a single .cpp with a macro that expands to the tested
name. See libs/log/test/Jamfile.v2, rule test_all and
there are no header 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