[cmake-developers] Unittests with reconfiguration

Raffi Enficiaud raffi.enficiaud at mines-paris.org
Mon Apr 27 11:04:33 EDT 2015


Le 27/04/15 15:22, Brad King a écrit :
> On 04/27/2015 07:16 AM, David Cole wrote:
>> https://github.com/Kitware/CMake/blob/master/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
>>
>> On Mon, Apr 27, 2015 at 4:13 AM, Raffi Enficiaud wrote:
>>> I would like to know if it is possible to have a unit test with two runs of
>>> cmake, simulating a user change of the cache in between.
>>>
>>> I am right now looking at RunCMake but I do not think this scheme is
>>> suitable for that.
>
> We're trying to make RunCMake able to handle all tests that involve
> checking the output and generation results.  Its default behavior
> is to use a separate build tree for every case and wipe it out
> to start fresh each time.  There are options to change this.  Some
> tests do what you need already.  For example, look at
>
>   Tests/RunCMake/configure_file/RunCMakeTest.cmake
>
> for use of RunCMake_TEST_BINARY_DIR and RunCMake_TEST_NO_CLEAN.
> The pattern followed there has been repeated several times in
> other tests, so it may be worth trying to refactor it out into
> some kind of helper.
>
> -Brad
>

Hi,
Thanks both of you for your replies. It looks like the 
configure_file/RunCMakeTest.cmake is exactly what I need!

Best,
Raffi




More information about the cmake-developers mailing list