Boost logo

Boost Testing :

Subject: Re: [Boost-testing] Disable test if not compiling with c++11
From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2016-07-17 00:11:44


On Sat, Jul 16, 2016 at 6:11 PM, Belcourt, Kenneth <kbelco_at_[hidden]>
wrote:

> Hi,
>
> This graph test case only compiles with c++11, otherwise fails with a
> compile error.
>
> [ run csr_graph_test.cpp : : : : : <variant>release ]
>
> Is there something like this to omit this test if not using c++11?
>
> [ run csr_graph_test.cpp : : : : : <variant>release <std>c++11 ]
>
> Or is there another way to accomplish this?
>

One limited possibility is to use the Predef Check utility [1] to test
against BOOST_LANG_STDCPP. For example:

import path-to-predef-src/tools/check/predef
    : check require
    : predef-check predef-require ;

run csr_graph_test.cpp : : : : : <variant>release [ predef-require
"BOOST_LANG_STDCPP >= 41.3.1" ] ;

But I say limited because not many compilers will set the language predef
even if they support some particular C++11 feature you need. And depending
on the language feature you could also use the Boost Config check utility
[2].

[1] <
http://www.boost.org/doc/libs/1_61_0/libs/predef/doc/html/predef/check_utilities.html
>
[2] <
http://www.boost.org/doc/libs/1_61_0/libs/config/doc/html/boost_config/build_config.html
>

-- 
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net
-- rrivera/acm.org (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail


Boost-testing list run by mbergal at meta-comm.com