[cmake-developers] Testing Config generator expression
David Cole
david.cole at kitware.com
Thu Nov 1 11:45:46 EDT 2012
On Thu, Nov 1, 2012 at 11:17 AM, Brad King <brad.king at kitware.com> wrote:
> On 11/01/2012 11:06 AM, Stephen Kelly wrote:
>> RunCMake.cmake seems to use:
>>
>> execute_process(
>> COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
>> -G "${RunCMake_GENERATOR}" -DRunCMake_TEST=${test}
>>
>> I'm not sure if I should just add API for a -
>> DCMAKE_BUILD_TYPE=${RunCMake_BUILD_TYPE} there and just limit the test for
>> this to the makefile generators?
>
> No, the test infrastructure should not need modification for this.
> Under IDE generators the generator expression will be evaluated
> once for every configuration. Perhaps RunCMake isn't the best
> category of tests after all.
>
> Instead update Tests/GeneratorExpression to do
>
> -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG>
> -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE>
> ...other two configs...
>
> Then in check.cmake verify that each variable is set to all 0s
> or all 1s.
>
> -Brad
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Consider also the CTestConfig set of tests. They run ctest with -C
configname to run all 4 types of dashboards (via -S script *and* via
ctest -D args) regardless of the build type of the outer CMake
dashboard. See "add_config_tests" in Tests/CMakeLists.txt and its
associated files in the Tests/CTestConfig directory.
You could do something similar where the ctest -S script only runs the
configure step, but exercise all 4 well-known config types that way.
HTH,
David
More information about the cmake-developers
mailing list