Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-07-19 06:30:55


I think you have metaprogramming on the brain ;-)

Seriously, wouldn't we do just as well with a run-time report?
The cost of finishing the link and running the program is low, and the
results will be easier for the test system to interpret...

-Dave

From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>

> How about something like this:
>
> // some trait to test
> template< typename T1 > struct identity
> {
> typedef T1 type;
> };
>
> IS_SAME(false,identity<int>::type,int) // no failures expected;
compilation
> error ("FAIL") if the check fails
> IS_SAME(TT_MSVC < 1300,identity<char*>::type,char*) // expected failure
on
> MSVC 6.5 and below
>
> If the test is compiled under MSVC and the last line fails, the test will
> not _link_ with an error like this:
>
> test.obj : error LNK2019: unresolved external symbol "public: static void
> __cdecl tt_test<1,struct void_,39>::EXPECTED_FAILURE(void)"
>
> where "39" is the line number, which in your classification would
correspond
> to "PASS*". If it unexpectedly passes under MSVC, then you will also get
a
> link error, but a slightly different one:
>
> test.obj : error LNK2019: unresolved external symbol "public: static void
> __cdecl tt_test<1,struct void_,39>::UNEXPECTED_PASS(void)"
>
> which would mean "PASS?". If it fails on another compiler, it's still a
> compilation error ("FAIL").
>
> Of course, we would need a special support somewhere in the chain to
> transform those link errors into a test status.
>
> Just a thought.
>
> Aleksey
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
>


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