Quantcast

Disable test if not compiling with c++11

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Disable test if not compiling with c++11

Belcourt, Kenneth
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?

Thanks.

—- Noel

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Disable test if not compiling with c++11

Rene Rivera-2
On Sat, Jul 16, 2016 at 6:11 PM, Belcourt, Kenneth <[hidden email]> 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].




--
-- 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 mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Disable test if not compiling with c++11

John Maddock-2

> 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].
>

It cut's both ways: there are compilers that don't set __cplusplus to
the 2011 value but which will none the less compile your code, others
which do, but which will not compile your code.  So I would be inclined
to use the actual config check macros you use in your code in the
Boost.Config build checks.  Also add some #ifdef's to the test case
source so it becomes a "do nothing" test on compilers that don't support
the features you're using.

HTH, John.

>
> [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 <http://robot-dreams.net/>
> -- rrivera/acm.org
> <http://acm.org/> (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail
>
>
> _______________________________________________
> Boost-Testing mailing list
> [hidden email]
> http://lists.boost.org/mailman/listinfo.cgi/boost-testing

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Disable test if not compiling with c++11

Robert Ramey
In reply to this post by Rene Rivera-2
On 7/16/16 9:11 PM, Rene Rivera wrote:
>     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?
>

I can't find any information on the <std>  .  Where should I be looking?

I've look at
http://www.boost.org/build/doc/html/bbv2/overview/builtins/features.html

Robert Ramey

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Disable test if not compiling with c++11

Steven Watanabe-4
AMDG

On 07/17/2016 11:50 AM, Robert Ramey wrote:

> On 7/16/16 9:11 PM, Rene Rivera wrote:
>>     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?
>>
>
> I can't find any information on the <std>  .  Where should I be looking?
>
> I've look at
> http://www.boost.org/build/doc/html/bbv2/overview/builtins/features.html
>

It's a hypothetical feature that doesn't actually exist.

In Christ,
Steven Watanabe

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [EXTERNAL] Disable test if not compiling with c++11

Belcourt, Kenneth

> On Jul 17, 2016, at 1:19 PM, Steven Watanabe <[hidden email]> wrote:
>
> On 07/17/2016 11:50 AM, Robert Ramey wrote:
>> On 7/16/16 9:11 PM, Rene Rivera wrote:
>>>    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?
>>>
>>
>> I can't find any information on the <std>  .  Where should I be looking?
>>
>> I've look at
>> http://www.boost.org/build/doc/html/bbv2/overview/builtins/features.html
>
> It's a hypothetical feature that doesn't actually exist.

Exactly.  I was just looking for ways to mark test cases in the Jamfile by the minimum std they support.  While I can test macros in the source code to accomplish the same thing, I thought it’d be easier if I could mark the tests right in the Jamfile.

Thanks for all the insights.

— Noel

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Disable test if not compiling with c++11

Raffi Enficiaud-3
In reply to this post by Belcourt, Kenneth
Le 17/07/16 à 01:11, Belcourt, Kenneth a écrit :

> 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?
>
> Thanks.
>
> —- Noel

Hi,

This is not exactly what you are asking for, but might be useful: for
boost.test, I use the compiler capabilities/requirements instead:
- https://github.com/boostorg/test/blob/develop/test/Jamfile.v2
- https://github.com/boostorg/test/blob/develop/test/Jamfile.v2#L135

Creating composite requirements seem to work as well:
- https://github.com/boostorg/test/blob/develop/test/Jamfile.v2#L22
- https://github.com/boostorg/test/blob/develop/test/Jamfile.v2#L26

IMO it should work better that checking for c++11, especially for
VStudio (or "gcc c++0x" vs "gcc c++11").

Hope this helps,
Raffi

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [EXTERNAL] Re: Disable test if not compiling with c++11

Belcourt, Kenneth

> On Jul 17, 2016, at 4:22 PM, Raffi Enficiaud <[hidden email]> wrote:
>
> Le 17/07/16 à 01:11, Belcourt, Kenneth a écrit :
>> 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?
>>
>> Thanks.
>>
>> —- Noel
>
> Hi,
>
> This is not exactly what you are asking for, but might be useful: for boost.test, I use the compiler capabilities/requirements instead:
> - https://github.com/boostorg/test/blob/develop/test/Jamfile.v2
> - https://github.com/boostorg/test/blob/develop/test/Jamfile.v2#L135
>
> Creating composite requirements seem to work as well:
> - https://github.com/boostorg/test/blob/develop/test/Jamfile.v2#L22
> - https://github.com/boostorg/test/blob/develop/test/Jamfile.v2#L26
>
> IMO it should work better that checking for c++11, especially for VStudio (or "gcc c++0x" vs "gcc c++11").
>
> Hope this helps,

Yes, that’s close to what I want.  Thanks for the info, I’ll check it out.

— Noel

_______________________________________________
Boost-Testing mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-testing
Loading...