Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-12-06 18:46:01


"Joel de Guzman" <djowel_at_[hidden]> writes:

> Hi,
>
> Usually, we write regression tests that must compile and pass.
> A compile failure is typically flagged as, ummm, failure.
> There are times however when we explicitly want the compiler
> to fail on some code to check for API conformance. Here's an
> example from tuples:
>
> tuple<int, int, float> a;
> #ifdef E11
> a = std::make_pair(1, 2); // should fail, tuple is of length 3, not 2
> #endif
>
> How then should we test for such forced-errors which are
> basically negatives (i.e. a compiler success should be
> a regression failure)? Is there a way to make bjam report
> such failures as successes, for example?

See the compile-fail and link-fail rules in
tools/build/testing.jam. You really should use the version of
testing.jam on the "sane-testing" branch of the current CVS, as that
is the future of testing with bjam. Beman has not yet gotten around to
updating the HTML table-generation tools to work with that version,
which is why it's still sitting on the branch.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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