On Wed, Jun 17, 2015 at 5:57 PM, Paul A. Bristow
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.