Adding compile and build type tests to CMake/CTest

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding compile and build type tests to CMake/CTest

Edward Diener
Boost Build has tests for running an application successfully or not,
for compiling one or more source files successfully or not, and for
building one or more source files into an exe or not. These tests in
Boost Build are the run/run-fail, compile/compile-fail, and
link/link-fail rules.

CMake/CTest has the exact equivalent to the run/run-fail rule in its
add_test framework, but there is not add_test equivalent to the other
two sets of rules. It sure would be nice, when Boost transitions to
using CMake/CTest instead of Boost Build, if CMake/CTest had the
equivalent of the other two sets of types of test in its add_test
framework.

Is there any consensus that these other two types of tests might be
valuable for CMake/CTest, or any way to make this happen ?

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

rleigh
On 04/09/17 14:40, Edward Diener wrote:

> Boost Build has tests for running an application successfully or not,
> for compiling one or more source files successfully or not, and for
> building one or more source files into an exe or not. These tests in
> Boost Build are the run/run-fail, compile/compile-fail, and
> link/link-fail rules.
>
> CMake/CTest has the exact equivalent to the run/run-fail rule in its
> add_test framework, but there is not add_test equivalent to the other
> two sets of rules. It sure would be nice, when Boost transitions to
> using CMake/CTest instead of Boost Build, if CMake/CTest had the
> equivalent of the other two sets of types of test in its add_test
> framework.
>
> Is there any consensus that these other two types of tests might be
> valuable for CMake/CTest, or any way to make this happen ?

I've certainly wished for them.  Particularly when testing templated
code where you want to test that certain things fail correctly, e.g. via
static_assert or simply being invalid.

I understand it's possible to make this work partially, by creating
targets which aren't built by default, and then add tests which invoke
the targets.  But this appears to have some caveats, such as potential
misbehaviour with parallel testing.  Or you can have a separate CMake
build for each individual target, but it's extra complexity.  Having a
proper means of registering such tests would be very, very nice.


Regards,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Dvir Yitzchaki
There's already CheckCXXSourceCompiles and friends.
The only problem is that try_compile is not scriptable otherwise you could let the test invoke
${CMAKE_COMMAND} -P check_source_compiles.cmake.

-----Original Message-----
From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
Sent: Monday, September 4, 2017 16:51
To: [hidden email]
Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest

On 04/09/17 14:40, Edward Diener wrote:

> Boost Build has tests for running an application successfully or not,
> for compiling one or more source files successfully or not, and for
> building one or more source files into an exe or not. These tests in
> Boost Build are the run/run-fail, compile/compile-fail, and
> link/link-fail rules.
>
> CMake/CTest has the exact equivalent to the run/run-fail rule in its
> add_test framework, but there is not add_test equivalent to the other
> two sets of rules. It sure would be nice, when Boost transitions to
> using CMake/CTest instead of Boost Build, if CMake/CTest had the
> equivalent of the other two sets of types of test in its add_test
> framework.
>
> Is there any consensus that these other two types of tests might be
> valuable for CMake/CTest, or any way to make this happen ?

I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.

I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.


Regards,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
In reply to this post by rleigh
On 9/4/2017 9:51 AM, Roger Leigh wrote:

> On 04/09/17 14:40, Edward Diener wrote:
>> Boost Build has tests for running an application successfully or not,
>> for compiling one or more source files successfully or not, and for
>> building one or more source files into an exe or not. These tests in
>> Boost Build are the run/run-fail, compile/compile-fail, and
>> link/link-fail rules.
>>
>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
>> add_test framework, but there is not add_test equivalent to the other
>> two sets of rules. It sure would be nice, when Boost transitions to
>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
>> equivalent of the other two sets of types of test in its add_test
>> framework.
>>
>> Is there any consensus that these other two types of tests might be
>> valuable for CMake/CTest, or any way to make this happen ?
>
> I've certainly wished for them.  Particularly when testing templated
> code where you want to test that certain things fail correctly, e.g. via
> static_assert or simply being invalid.

I think that CMake has missed out on the simple fact that in modern C++
you can create compile-time tests/asserts rather than rely on run-time
tests. In other words CMake has no provision for compile-time testing,
only run-time testing. In this respect CMake is definitely behind the
curve of modern C++ development. Of course unless the CMake developers
wake up to this simple fact, and plan to provide compile-time testing,
and possibly even build testing, ala Boost Build, to CMake it will
remain behind the curve for modern C++ development.

When the Boost Steering Committee decided to move Boost to using CMake
in the near future, it may not have taken into account the fact that
CMake might be missing something that modern C++ development in Boost
uses via Boost Build. Unless there is some sort of push back to the
CMake developers so that the needed functionality is added to CMake, it
is going to be a long, hard road for converting from Boost Build to
CMake for the Boost library and tools. This is not a knock against
CMake, which is widely used and widely popular, but rather a recognition
that Boost uses modern C++ and CMake may not provide all the
building/testing facilities needed for a modern C++ development
environment such as Boost.

>
> I understand it's possible to make this work partially, by creating
> targets which aren't built by default, and then add tests which invoke
> the targets.  But this appears to have some caveats, such as potential
> misbehaviour with parallel testing.  Or you can have a separate CMake
> build for each individual target, but it's extra complexity.  Having a
> proper means of registering such tests would be very, very nice.
>
>
> Regards,
> Roger


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
In reply to this post by Dvir Yitzchaki
On 9/5/2017 2:47 AM, Dvir Yitzchaki wrote:
> There's already CheckCXXSourceCompiles and friends.
> The only problem is that try_compile is not scriptable otherwise you could let the test invoke
> ${CMAKE_COMMAND} -P check_source_compiles.cmake.

To put it succinctly CMake should adding compile-time testing so that
when some compilation succeeds the test is successful and if the
compilation fails the test is not successful, with the proviso that you
can reverse the result as a compile should fail type of test. Similarly
a build type testing, without having to run anything should be added
along the same lines.

In modern C++ it is perfectly feasible, especially with template
programming, to do compile time testing, invoking a compile-time static
assert as a compile-time failure. Boost has had this for years and
modern C++ has it as part of the latest version of the C++ standard.
CMake needs to update itself to the reality that pure compile-time
testing is a reality for modern C++ and should update itself
accordingly. Only having run-time testing is an artifact of the past.
Hopefully CMake developers will get the message and make the necessary
update to CMake/CTest.

>
> -----Original Message-----
> From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
> Sent: Monday, September 4, 2017 16:51
> To: [hidden email]
> Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest
>
> On 04/09/17 14:40, Edward Diener wrote:
>> Boost Build has tests for running an application successfully or not,
>> for compiling one or more source files successfully or not, and for
>> building one or more source files into an exe or not. These tests in
>> Boost Build are the run/run-fail, compile/compile-fail, and
>> link/link-fail rules.
>>
>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
>> add_test framework, but there is not add_test equivalent to the other
>> two sets of rules. It sure would be nice, when Boost transitions to
>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
>> equivalent of the other two sets of types of test in its add_test
>> framework.
>>
>> Is there any consensus that these other two types of tests might be
>> valuable for CMake/CTest, or any way to make this happen ?
>
> I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.
>
> I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.
>
>
> Regards,
> Roger
>


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

CMake mailing list
The `add_test` function can run whatever command you want it to, including compiling a target:

add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
add_test(NAME foo_compile_test
    COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config $<CONFIGURATION>
    WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

Then you set cmake to expect failure:

set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)

You can also check for output instead of just expecting failure:

set_tests_properties(mytest PROPERTIES
  PASS_REGULAR_EXPRESSION "foo failed"
)

This is especially useful to make sure that the error is from the static_assert message and not from another compile error.

Of course, cmake could provide a module which provides a function to do this, which additionally could help workaround the caveats of this approach. This is essentially what `bcm_test` in the boost cmake modules do. Hopefully, in the future this module could be merged upstream into cmake.


> On Sep 5, 2017, at 11:44 AM, Edward Diener <[hidden email]> wrote:
>
> On 9/5/2017 2:47 AM, Dvir Yitzchaki wrote:
>> There's already CheckCXXSourceCompiles and friends.
>> The only problem is that try_compile is not scriptable otherwise you could let the test invoke
>> ${CMAKE_COMMAND} -P check_source_compiles.cmake.
>
> To put it succinctly CMake should adding compile-time testing so that when some compilation succeeds the test is successful and if the compilation fails the test is not successful, with the proviso that you can reverse the result as a compile should fail type of test. Similarly a build type testing, without having to run anything should be added along the same lines.
>
> In modern C++ it is perfectly feasible, especially with template programming, to do compile time testing, invoking a compile-time static assert as a compile-time failure. Boost has had this for years and modern C++ has it as part of the latest version of the C++ standard. CMake needs to update itself to the reality that pure compile-time testing is a reality for modern C++ and should update itself accordingly. Only having run-time testing is an artifact of the past. Hopefully CMake developers will get the message and make the necessary update to CMake/CTest.
>
>> -----Original Message-----
>> From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
>> Sent: Monday, September 4, 2017 16:51
>> To: [hidden email]
>> Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest
>> On 04/09/17 14:40, Edward Diener wrote:
>>> Boost Build has tests for running an application successfully or not,
>>> for compiling one or more source files successfully or not, and for
>>> building one or more source files into an exe or not. These tests in
>>> Boost Build are the run/run-fail, compile/compile-fail, and
>>> link/link-fail rules.
>>>
>>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
>>> add_test framework, but there is not add_test equivalent to the other
>>> two sets of rules. It sure would be nice, when Boost transitions to
>>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
>>> equivalent of the other two sets of types of test in its add_test
>>> framework.
>>>
>>> Is there any consensus that these other two types of tests might be
>>> valuable for CMake/CTest, or any way to make this happen ?
>> I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.
>> I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.
>> Regards,
>> Roger
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
On 9/6/2017 11:39 PM, P F via CMake wrote:

> The `add_test` function can run whatever command you want it to, including compiling a target:
>
> add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
> add_test(NAME foo_compile_test
>      COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config $<CONFIGURATION>
>      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
>
> Then you set cmake to expect failure:
>
> set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)
>
> You can also check for output instead of just expecting failure:
>
> set_tests_properties(mytest PROPERTIES
>    PASS_REGULAR_EXPRESSION "foo failed"
> )
>
> This is especially useful to make sure that the error is from the static_assert message and not from another compile error.
>
> Of course, cmake could provide a module which provides a function to do this, which additionally could help workaround the caveats of this approach. This is essentially what `bcm_test` in the boost cmake modules do. > > Hopefully, in the future this module could be merged upstream into cmake.

It seems like a hack to have to build a CMake target, with the
add_library call, just to compile a source file as a test. You end up
creating libraries, even if they are static libraries, just to test a
compile. I understand that it might be seen that creating static
libraries is no different than creating object files, but this technique
appears to me a limitation of CMake. I should be able to add a test
which just attempts to compile source file(s) into object file(s), not
create static libraries.

>
>
>> On Sep 5, 2017, at 11:44 AM, Edward Diener <[hidden email]> wrote:
>>
>> On 9/5/2017 2:47 AM, Dvir Yitzchaki wrote:
>>> There's already CheckCXXSourceCompiles and friends.
>>> The only problem is that try_compile is not scriptable otherwise you could let the test invoke
>>> ${CMAKE_COMMAND} -P check_source_compiles.cmake.
>>
>> To put it succinctly CMake should adding compile-time testing so that when some compilation succeeds the test is successful and if the compilation fails the test is not successful, with the proviso that you can reverse the result as a compile should fail type of test. Similarly a build type testing, without having to run anything should be added along the same lines.
>>
>> In modern C++ it is perfectly feasible, especially with template programming, to do compile time testing, invoking a compile-time static assert as a compile-time failure. Boost has had this for years and modern C++ has it as part of the latest version of the C++ standard. CMake needs to update itself to the reality that pure compile-time testing is a reality for modern C++ and should update itself accordingly. Only having run-time testing is an artifact of the past. Hopefully CMake developers will get the message and make the necessary update to CMake/CTest.
>>
>>> -----Original Message-----
>>> From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
>>> Sent: Monday, September 4, 2017 16:51
>>> To: [hidden email]
>>> Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest
>>> On 04/09/17 14:40, Edward Diener wrote:
>>>> Boost Build has tests for running an application successfully or not,
>>>> for compiling one or more source files successfully or not, and for
>>>> building one or more source files into an exe or not. These tests in
>>>> Boost Build are the run/run-fail, compile/compile-fail, and
>>>> link/link-fail rules.
>>>>
>>>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
>>>> add_test framework, but there is not add_test equivalent to the other
>>>> two sets of rules. It sure would be nice, when Boost transitions to
>>>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
>>>> equivalent of the other two sets of types of test in its add_test
>>>> framework.
>>>>
>>>> Is there any consensus that these other two types of tests might be
>>>> valuable for CMake/CTest, or any way to make this happen ?
>>> I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.
>>> I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.
>>> Regards,
>>> Roger


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

CHEVRIER, Marc
Rather than building a STATIC library, you can build an OBJECT library. In this case only compilation step is done.

On 07/09/2017, 08:59, "CMake on behalf of Edward Diener" <[hidden email] on behalf of [hidden email]> wrote:

    On 9/6/2017 11:39 PM, P F via CMake wrote:
    > The `add_test` function can run whatever command you want it to, including compiling a target:
    >
    > add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
    > add_test(NAME foo_compile_test
    >      COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config $<CONFIGURATION>
    >      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
    >
    > Then you set cmake to expect failure:
    >
    > set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)
    >
    > You can also check for output instead of just expecting failure:
    >
    > set_tests_properties(mytest PROPERTIES
    >    PASS_REGULAR_EXPRESSION "foo failed"
    > )
    >
    > This is especially useful to make sure that the error is from the static_assert message and not from another compile error.
    >
    > Of course, cmake could provide a module which provides a function to do this, which additionally could help workaround the caveats of this approach. This is essentially what `bcm_test` in the boost cmake modules do. > > Hopefully, in the future this module could be merged upstream into cmake.
   
    It seems like a hack to have to build a CMake target, with the
    add_library call, just to compile a source file as a test. You end up
    creating libraries, even if they are static libraries, just to test a
    compile. I understand that it might be seen that creating static
    libraries is no different than creating object files, but this technique
    appears to me a limitation of CMake. I should be able to add a test
    which just attempts to compile source file(s) into object file(s), not
    create static libraries.
   
    >
    >
    >> On Sep 5, 2017, at 11:44 AM, Edward Diener <[hidden email]> wrote:
    >>
    >> On 9/5/2017 2:47 AM, Dvir Yitzchaki wrote:
    >>> There's already CheckCXXSourceCompiles and friends.
    >>> The only problem is that try_compile is not scriptable otherwise you could let the test invoke
    >>> ${CMAKE_COMMAND} -P check_source_compiles.cmake.
    >>
    >> To put it succinctly CMake should adding compile-time testing so that when some compilation succeeds the test is successful and if the compilation fails the test is not successful, with the proviso that you can reverse the result as a compile should fail type of test. Similarly a build type testing, without having to run anything should be added along the same lines.
    >>
    >> In modern C++ it is perfectly feasible, especially with template programming, to do compile time testing, invoking a compile-time static assert as a compile-time failure. Boost has had this for years and modern C++ has it as part of the latest version of the C++ standard. CMake needs to update itself to the reality that pure compile-time testing is a reality for modern C++ and should update itself accordingly. Only having run-time testing is an artifact of the past. Hopefully CMake developers will get the message and make the necessary update to CMake/CTest.
    >>
    >>> -----Original Message-----
    >>> From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
    >>> Sent: Monday, September 4, 2017 16:51
    >>> To: [hidden email]
    >>> Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest
    >>> On 04/09/17 14:40, Edward Diener wrote:
    >>>> Boost Build has tests for running an application successfully or not,
    >>>> for compiling one or more source files successfully or not, and for
    >>>> building one or more source files into an exe or not. These tests in
    >>>> Boost Build are the run/run-fail, compile/compile-fail, and
    >>>> link/link-fail rules.
    >>>>
    >>>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
    >>>> add_test framework, but there is not add_test equivalent to the other
    >>>> two sets of rules. It sure would be nice, when Boost transitions to
    >>>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
    >>>> equivalent of the other two sets of types of test in its add_test
    >>>> framework.
    >>>>
    >>>> Is there any consensus that these other two types of tests might be
    >>>> valuable for CMake/CTest, or any way to make this happen ?
    >>> I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.
    >>> I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.
    >>> Regards,
    >>> Roger
   
   
    --
   
    Powered by www.kitware.com
   
    Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
   
    Kitware offers various services to support the CMake community. For more information on each offering, please visit:
   
    CMake Support: http://cmake.org/cmake/help/support.html
    CMake Consulting: http://cmake.org/cmake/help/consulting.html
    CMake Training Courses: http://cmake.org/cmake/help/training.html
   
    Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
   
    Follow this link to subscribe/unsubscribe:
    http://public.kitware.com/mailman/listinfo/cmake
   

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
On 9/7/2017 3:32 AM, CHEVRIER, Marc wrote:
> Rather than building a STATIC library, you can build an OBJECT library. In this case only compilation step is done.

So your are saying that:

add_library(foo_compile_test OBJECT EXCLUDE_FROM_ALL foo_compile_test.cpp)
add_test(NAME foo_compile_test
      COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test
--config $<CONFIGURATION>
      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

should work properly ?

>
> On 07/09/2017, 08:59, "CMake on behalf of Edward Diener" <[hidden email] on behalf of eldlistmailingz-5p0dqD/[hidden email]> wrote:
>
>      On 9/6/2017 11:39 PM, P F via CMake wrote:
>      > The `add_test` function can run whatever command you want it to, including compiling a target:
>      >
>      > add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
>      > add_test(NAME foo_compile_test
>      >      COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config $<CONFIGURATION>
>      >      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
>      >
>      > Then you set cmake to expect failure:
>      >
>      > set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)
>      >
>      > You can also check for output instead of just expecting failure:
>      >
>      > set_tests_properties(mytest PROPERTIES
>      >    PASS_REGULAR_EXPRESSION "foo failed"
>      > )
>      >
>      > This is especially useful to make sure that the error is from the static_assert message and not from another compile error.
>      >
>      > Of course, cmake could provide a module which provides a function to do this, which additionally could help workaround the caveats of this approach. This is essentially what `bcm_test` in the boost cmake modules do. > > Hopefully, in the future this module could be merged upstream into cmake.
>      
>      It seems like a hack to have to build a CMake target, with the
>      add_library call, just to compile a source file as a test. You end up
>      creating libraries, even if they are static libraries, just to test a
>      compile. I understand that it might be seen that creating static
>      libraries is no different than creating object files, but this technique
>      appears to me a limitation of CMake. I should be able to add a test
>      which just attempts to compile source file(s) into object file(s), not
>      create static libraries.
>      
>      >
>      >
>      >> On Sep 5, 2017, at 11:44 AM, Edward Diener <[hidden email]> wrote:
>      >>
>      >> On 9/5/2017 2:47 AM, Dvir Yitzchaki wrote:
>      >>> There's already CheckCXXSourceCompiles and friends.
>      >>> The only problem is that try_compile is not scriptable otherwise you could let the test invoke
>      >>> ${CMAKE_COMMAND} -P check_source_compiles.cmake.
>      >>
>      >> To put it succinctly CMake should adding compile-time testing so that when some compilation succeeds the test is successful and if the compilation fails the test is not successful, with the proviso that you can reverse the result as a compile should fail type of test. Similarly a build type testing, without having to run anything should be added along the same lines.
>      >>
>      >> In modern C++ it is perfectly feasible, especially with template programming, to do compile time testing, invoking a compile-time static assert as a compile-time failure. Boost has had this for years and modern C++ has it as part of the latest version of the C++ standard. CMake needs to update itself to the reality that pure compile-time testing is a reality for modern C++ and should update itself accordingly. Only having run-time testing is an artifact of the past. Hopefully CMake developers will get the message and make the necessary update to CMake/CTest.
>      >>
>      >>> -----Original Message-----
>      >>> From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
>      >>> Sent: Monday, September 4, 2017 16:51
>      >>> To: [hidden email]
>      >>> Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest
>      >>> On 04/09/17 14:40, Edward Diener wrote:
>      >>>> Boost Build has tests for running an application successfully or not,
>      >>>> for compiling one or more source files successfully or not, and for
>      >>>> building one or more source files into an exe or not. These tests in
>      >>>> Boost Build are the run/run-fail, compile/compile-fail, and
>      >>>> link/link-fail rules.
>      >>>>
>      >>>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
>      >>>> add_test framework, but there is not add_test equivalent to the other
>      >>>> two sets of rules. It sure would be nice, when Boost transitions to
>      >>>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
>      >>>> equivalent of the other two sets of types of test in its add_test
>      >>>> framework.
>      >>>>
>      >>>> Is there any consensus that these other two types of tests might be
>      >>>> valuable for CMake/CTest, or any way to make this happen ?
>      >>> I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.
>      >>> I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.
>      >>> Regards,
>      >>> Roger

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

CHEVRIER, Marc
Yes, exactly.
I think so…

On 07/09/2017, 16:04, "CMake on behalf of Edward Diener" <[hidden email] on behalf of [hidden email]> wrote:

    On 9/7/2017 3:32 AM, CHEVRIER, Marc wrote:
    > Rather than building a STATIC library, you can build an OBJECT library. In this case only compilation step is done.
   
    So your are saying that:
   
    add_library(foo_compile_test OBJECT EXCLUDE_FROM_ALL foo_compile_test.cpp)
    add_test(NAME foo_compile_test
          COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test
    --config $<CONFIGURATION>
          WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
   
    should work properly ?
   
    >
    > On 07/09/2017, 08:59, "CMake on behalf of Edward Diener" <[hidden email] on behalf of eldlistmailingz-5p0dqD/[hidden email]> wrote:
    >
    >      On 9/6/2017 11:39 PM, P F via CMake wrote:
    >      > The `add_test` function can run whatever command you want it to, including compiling a target:
    >      >
    >      > add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
    >      > add_test(NAME foo_compile_test
    >      >      COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config $<CONFIGURATION>
    >      >      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
    >      >
    >      > Then you set cmake to expect failure:
    >      >
    >      > set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)
    >      >
    >      > You can also check for output instead of just expecting failure:
    >      >
    >      > set_tests_properties(mytest PROPERTIES
    >      >    PASS_REGULAR_EXPRESSION "foo failed"
    >      > )
    >      >
    >      > This is especially useful to make sure that the error is from the static_assert message and not from another compile error.
    >      >
    >      > Of course, cmake could provide a module which provides a function to do this, which additionally could help workaround the caveats of this approach. This is essentially what `bcm_test` in the boost cmake modules do. > > Hopefully, in the future this module could be merged upstream into cmake.
    >      
    >      It seems like a hack to have to build a CMake target, with the
    >      add_library call, just to compile a source file as a test. You end up
    >      creating libraries, even if they are static libraries, just to test a
    >      compile. I understand that it might be seen that creating static
    >      libraries is no different than creating object files, but this technique
    >      appears to me a limitation of CMake. I should be able to add a test
    >      which just attempts to compile source file(s) into object file(s), not
    >      create static libraries.
    >      
    >      >
    >      >
    >      >> On Sep 5, 2017, at 11:44 AM, Edward Diener <[hidden email]> wrote:
    >      >>
    >      >> On 9/5/2017 2:47 AM, Dvir Yitzchaki wrote:
    >      >>> There's already CheckCXXSourceCompiles and friends.
    >      >>> The only problem is that try_compile is not scriptable otherwise you could let the test invoke
    >      >>> ${CMAKE_COMMAND} -P check_source_compiles.cmake.
    >      >>
    >      >> To put it succinctly CMake should adding compile-time testing so that when some compilation succeeds the test is successful and if the compilation fails the test is not successful, with the proviso that you can reverse the result as a compile should fail type of test. Similarly a build type testing, without having to run anything should be added along the same lines.
    >      >>
    >      >> In modern C++ it is perfectly feasible, especially with template programming, to do compile time testing, invoking a compile-time static assert as a compile-time failure. Boost has had this for years and modern C++ has it as part of the latest version of the C++ standard. CMake needs to update itself to the reality that pure compile-time testing is a reality for modern C++ and should update itself accordingly. Only having run-time testing is an artifact of the past. Hopefully CMake developers will get the message and make the necessary update to CMake/CTest.
    >      >>
    >      >>> -----Original Message-----
    >      >>> From: CMake [mailto:[hidden email]] On Behalf Of Roger Leigh
    >      >>> Sent: Monday, September 4, 2017 16:51
    >      >>> To: [hidden email]
    >      >>> Subject: Re: [CMake] Adding compile and build type tests to CMake/CTest
    >      >>> On 04/09/17 14:40, Edward Diener wrote:
    >      >>>> Boost Build has tests for running an application successfully or not,
    >      >>>> for compiling one or more source files successfully or not, and for
    >      >>>> building one or more source files into an exe or not. These tests in
    >      >>>> Boost Build are the run/run-fail, compile/compile-fail, and
    >      >>>> link/link-fail rules.
    >      >>>>
    >      >>>> CMake/CTest has the exact equivalent to the run/run-fail rule in its
    >      >>>> add_test framework, but there is not add_test equivalent to the other
    >      >>>> two sets of rules. It sure would be nice, when Boost transitions to
    >      >>>> using CMake/CTest instead of Boost Build, if CMake/CTest had the
    >      >>>> equivalent of the other two sets of types of test in its add_test
    >      >>>> framework.
    >      >>>>
    >      >>>> Is there any consensus that these other two types of tests might be
    >      >>>> valuable for CMake/CTest, or any way to make this happen ?
    >      >>> I've certainly wished for them.  Particularly when testing templated code where you want to test that certain things fail correctly, e.g. via static_assert or simply being invalid.
    >      >>> I understand it's possible to make this work partially, by creating targets which aren't built by default, and then add tests which invoke the targets.  But this appears to have some caveats, such as potential misbehaviour with parallel testing.  Or you can have a separate CMake build for each individual target, but it's extra complexity.  Having a proper means of registering such tests would be very, very nice.
    >      >>> Regards,
    >      >>> Roger
   
    --
   
    Powered by www.kitware.com
   
    Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
   
    Kitware offers various services to support the CMake community. For more information on each offering, please visit:
   
    CMake Support: http://cmake.org/cmake/help/support.html
    CMake Consulting: http://cmake.org/cmake/help/consulting.html
    CMake Training Courses: http://cmake.org/cmake/help/training.html
   
    Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
   
    Follow this link to subscribe/unsubscribe:
    http://public.kitware.com/mailman/listinfo/cmake
   

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

CMake mailing list
In reply to this post by Edward Diener
On Thu, 2017-09-07 at 02:58 -0400, Edward Diener wrote:

> On 9/6/2017 11:39 PM, P F via CMake wrote:
> >
> > The `add_test` function can run whatever command you want it to, including
> > compiling a target:
> >
> > add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
> > add_test(NAME foo_compile_test
> >      COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config
> > $<CONFIGURATION>
> >      WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
> >
> > Then you set cmake to expect failure:
> >
> > set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)
> >
> > You can also check for output instead of just expecting failure:
> >
> > set_tests_properties(mytest PROPERTIES
> >    PASS_REGULAR_EXPRESSION "foo failed"
> > )
> >
> > This is especially useful to make sure that the error is from the
> > static_assert message and not from another compile error.
> >
> > Of course, cmake could provide a module which provides a function to do
> > this, which additionally could help workaround the caveats of this
> > approach. This is essentially what `bcm_test` in the boost cmake modules
> > do. > > Hopefully, in the future this module could be merged upstream into
> > cmake.
> It seems like a hack to have to build a CMake target, with the 
> add_library call, just to compile a source file as a test.


I dont see how this is a hack. Cmake is target-oriented, if I want to control
the compile flags for this compile-test, I can do:

target_compile_options(foo_compile_test -Wall -Werror)

If it were builtin to cmake, how would the user set the compile options? It
seems cmake would need to add `target_*` based function for compile tests as
well. This seems bloated and inconsistent. 


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
On 9/7/2017 10:34 AM, paul via CMake wrote:

> On Thu, 2017-09-07 at 02:58 -0400, Edward Diener wrote:
>> On 9/6/2017 11:39 PM, P F via CMake wrote:
>>>
>>> The `add_test` function can run whatever command you want it to, including
>>> compiling a target:
>>>
>>> add_library(foo_compile_test STATIC EXCLUDE_FROM_ALL foo_compile_test.cpp)
>>> add_test(NAME foo_compile_test
>>>       COMMAND ${CMAKE_COMMAND} --build . --target foo_compile_test --config
>>> $<CONFIGURATION>
>>>       WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
>>>
>>> Then you set cmake to expect failure:
>>>
>>> set_tests_properties(foo_compile_test PROPERTIES WILL_FAIL TRUE)
>>>
>>> You can also check for output instead of just expecting failure:
>>>
>>> set_tests_properties(mytest PROPERTIES
>>>     PASS_REGULAR_EXPRESSION "foo failed"
>>> )
>>>
>>> This is especially useful to make sure that the error is from the
>>> static_assert message and not from another compile error.
>>>
>>> Of course, cmake could provide a module which provides a function to do
>>> this, which additionally could help workaround the caveats of this
>>> approach. This is essentially what `bcm_test` in the boost cmake modules
>>> do. > > Hopefully, in the future this module could be merged upstream into
>>> cmake.
>> It seems like a hack to have to build a CMake target, with the
>> add_library call, just to compile a source file as a test.
>
>
> I dont see how this is a hack. Cmake is target-oriented, if I want to control
> the compile flags for this compile-test, I can do:
>
> target_compile_options(foo_compile_test -Wall -Werror)
>
> If it were builtin to cmake, how would the user set the compile options? It
> seems cmake would need to add `target_*` based function for compile tests as
> well. This seems bloated and inconsistent.

I meant it was a hack because you need to add a build of a STATIC
library just to do a compile test. However if, as has been suggested,
you can alternatively add a build of an OBJECT library to do the compile
test, then that seems the correct way of doing it to me, if it actually
works. I am surprised that it works, else I imagine `bcm_test` would
have used that instead instead of building a STATIC library.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Robert Ramey
In reply to this post by Edward Diener
On 9/4/17 6:40 AM, Edward Diener wrote:

> Boost Build has tests for running an application successfully or not,
> for compiling one or more source files successfully or not, and for
> building one or more source files into an exe or not. These tests in
> Boost Build are the run/run-fail, compile/compile-fail, and
> link/link-fail rules.
>
> CMake/CTest has the exact equivalent to the run/run-fail rule in its
> add_test framework, but there is not add_test equivalent to the other
> two sets of rules. It sure would be nice, when Boost transitions to
> using CMake/CTest instead of Boost Build, if CMake/CTest had the
> equivalent of the other two sets of types of test in its add_test
> framework.
>
> Is there any consensus that these other two types of tests might be
> valuable for CMake/CTest, or any way to make this happen ?
>

I would like to second this suggestion.  The absence of this feature
presents a huge obstacle to replicating the functionality of the boost
build functionality with CMake.  It's amazing to me that after so many
years CMake doesn't have this functionality already.  It certainly seems
to me that this would be easy to implement.

I'm aware that suggestions using CMake macros have been proposed.  But
to the inexperienced user they are not intuitive or easy to understand.

Could we get some response on Edward's suggestion here? It's a serious
obstacle to implementing support of CMake in Boost libraries.

Robert Ramey

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

CMake mailing list

Indeed, such a feature would come in handy to test libraries for correctly failing on erronous user input.

 

What amazes me even more is that noone has stepped up yet to create CBench. A utility executable for measuring compilation times and capture output of some (micro)benchmark instrumentation, either one of its own or some external tool, like google/benchmark. Present output either as a table on the console, ASCII art or as .xls/.html… you get what I mean.

 

Has it never bothered anyone enough yet to create quantitative output of a build, other than the binary failed/passed kind tests?

 

Feladó: [hidden email]
Elküldve: 2017. szeptember 12., kedd 19:12
Címzett: [hidden email]
Tárgy: Re: [CMake] Adding compile and build type tests to CMake/CTest

 

On 9/4/17 6:40 AM, Edward Diener wrote:

> Boost Build has tests for running an application successfully or not,

> for compiling one or more source files successfully or not, and for

> building one or more source files into an exe or not. These tests in

> Boost Build are the run/run-fail, compile/compile-fail, and

> link/link-fail rules.

>

> CMake/CTest has the exact equivalent to the run/run-fail rule in its

> add_test framework, but there is not add_test equivalent to the other

> two sets of rules. It sure would be nice, when Boost transitions to

> using CMake/CTest instead of Boost Build, if CMake/CTest had the

> equivalent of the other two sets of types of test in its add_test

> framework.

>

> Is there any consensus that these other two types of tests might be

> valuable for CMake/CTest, or any way to make this happen ?

>

 

I would like to second this suggestion.  The absence of this feature

presents a huge obstacle to replicating the functionality of the boost

build functionality with CMake.  It's amazing to me that after so many

years CMake doesn't have this functionality already.  It certainly seems

to me that this would be easy to implement.

 

I'm aware that suggestions using CMake macros have been proposed.  But

to the inexperienced user they are not intuitive or easy to understand.

 

Could we get some response on Edward's suggestion here? It's a serious

obstacle to implementing support of CMake in Boost libraries.

 

Robert Ramey

 

--

 

Powered by www.kitware.com

 

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

 

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

 

CMake Support: http://cmake.org/cmake/help/support.html

CMake Consulting: http://cmake.org/cmake/help/consulting.html

CMake Training Courses: http://cmake.org/cmake/help/training.html

 

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

 

Follow this link to subscribe/unsubscribe:

http://public.kitware.com/mailman/listinfo/cmake

 


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Bill Hoffman
In reply to this post by Robert Ramey
On 9/12/2017 1:11 PM, Robert Ramey wrote:
>
> Could we get some response on Edward's suggestion here? It's a serious
> obstacle to implementing support of CMake in Boost libraries.
I don't think it would be a problem to implement something like this in
CMake.  It might make more sense to move this conversation to the
cmake-developers list where we can discuss the particulars of the
interface and implementation. Then we can figure out how to get it
implemented.

Edward, did you want to start the discussion on the cmake-developers list?

Thanks.

-Bill





--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
[hidden email]
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
On 9/14/2017 4:45 PM, Bill Hoffman wrote:

> On 9/12/2017 1:11 PM, Robert Ramey wrote:
>>
>> Could we get some response on Edward's suggestion here? It's a serious
>> obstacle to implementing support of CMake in Boost libraries.
> I don't think it would be a problem to implement something like this in
> CMake.  It might make more sense to move this conversation to the
> cmake-developers list where we can discuss the particulars of the
> interface and implementation. Then we can figure out how to get it
> implemented.
>
> Edward, did you want to start the discussion on the cmake-developers list?

I am not a CMake developer and I have been unable to subscribe to the
CMake developer's list. But if you want to move my request to the CMake
developers list please go ahead.

>
> Thanks.
>
> -Bill

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Adding compile and build type tests to CMake/CTest

Edward Diener
In reply to this post by Bill Hoffman
On 9/14/2017 4:45 PM, Bill Hoffman wrote:

> On 9/12/2017 1:11 PM, Robert Ramey wrote:
>>
>> Could we get some response on Edward's suggestion here? It's a serious
>> obstacle to implementing support of CMake in Boost libraries.
> I don't think it would be a problem to implement something like this in
> CMake.  It might make more sense to move this conversation to the
> cmake-developers list where we can discuss the particulars of the
> interface and implementation. Then we can figure out how to get it
> implemented.
>
> Edward, did you want to start the discussion on the cmake-developers list?

It looks like my subscription to the CMake developers list went through.

>
> Thanks.
>
> -Bill
>
>
>
>
>


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake