[CMake] CTestScript for all available git branches/tags

David Cole david.cole at kitware.com
Tue Nov 29 08:13:40 EST 2011


For CMake itself, we have a one-to-one correlation between a script
run and an entry that appears on the dashboard. We also have a common
script that's included for nearly all CMake dashboard submissions, and
we switch things that are different between different runs with simple
variable sets for the most part before including the common script.

We really only regularly test 3 branches: 'next' dashboards for CMake
appear in the Continuous section of CDash, 'nightly' dashboards appear
in the "Nightly" and "Nightly Expected" sections, and 'nightly-master'
dashboards appear in the "Nightly 2.8 Release" section. 'nightly' and
'nightly-master' are branches that are updated once per day at the
nightly start time by a robot from 'next' and 'master' respectively.

I would think you can do this however you like, but I would advise to
have a separate source tree for each branch that you want to test.
That way, when you do the 'ctest_update' call, you will only get the
changes on that branch since the previous ctest_update call. If you
use the same source tree, you'll be "changing" source files
needlessly, which makes Continuous dashboard results take much longer
to build incrementally, and also presents misleading information about
what changed on the CDash results.

I would have separate thin wrapper scripts for each branch that call a
common script. I would not loop over all known branches from one
script. A typical Continuous script has a loop for a single branch
that builds it over and over again as changes are pushed to that
branch.


HTH,
David


2011/11/29 Nicolas Desprès <nicolas.despres at gmail.com>:
>
>
> On Tue, Nov 29, 2011 at 8:21 AM, <norulez at me.com> wrote:
>>
>> Is the CMake mailing list dead?
>
> No :-)
> Although, I am also really interested in your request, I have never setup a
> ctest based continuous integration system so I don't have the answer. Maybe
> we could try your idea on a small project and see how it behaves.
> Regards,
> Nicolas
>>
>> Am 24.11.2011 um 15:45 schrieb "NoRulez" <norulez at me.com>:
>>
>> > So, nobody an idea?
>> >
>> > Do I only have to add an foreach loop like in the following example or
>> > is
>> > there more to do:
>> >
>> > #get all branches/tags into GIT_BRANCHES/GIT_TAGS
>> >
>> > FOREACH(GIT_BRANCH ${GIT_BRANCHES})
>> >    execute_process (COMMAND ${GIT_EXECUTABLE} checkout ${GIT_BRANCH}
>> > WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY})
>> >    ctest_start (${MODEL} TRACK ${MODEL})
>> >    ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE
>> > NUMBER_FILES)
>> >    ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
>> >    ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}")
>> >    ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}")
>> >    ctest_coverage ()
>> >    ctest_memcheck ()
>> >    ctest_submit ()
>> > ENDFOREACH()
>> >
>> > FOREACH(GIT_TAG ${GIT_TAGS})
>> >    execute_process (COMMAND ${GIT_EXECUTABLE} checkout -b ${GIT_TAG}
>> > WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY})
>> >    ctest_start (${MODEL} TRACK ${MODEL})
>> >    ctest_update (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE
>> > NUMBER_FILES)
>> >    ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
>> >    ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}")
>> >    ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}")
>> >    ctest_coverage ()
>> >    ctest_memcheck ()
>> >    ctest_submit ()
>> > ENDFOREACH()
>> >
>> > Thanks in advance
>> >
>> > Best Regards
>> > NoRulez
>> >
>> > -----Ursprüngliche Nachricht-----
>> > Von: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] Im Auftrag
>> > von
>> > norulez at me.com
>> > Gesendet: Sonntag, 20. November 2011 18:21
>> > An: CMake MailingList
>> > Betreff: [CMake] CTestScript for all available git branches/tags
>> >
>> > Hi,
>> >
>> > if I have two or more projects (let's say proj1 and proj2) and for the
>> > proj1 i've the branches v1.0 and v1.1. For proj2 i've the branches v1.0,
>> > v1.1 and the tag v1.3 for example.
>> >
>> > Currently CTest runs in Continuous and Nightly mode for the master
>> > branch.
>> > But I want to run those modes for every branch/tag for each project. So
>> > for
>> > e.g.:
>> >
>> > proj1/master
>> > proj1/v1.0
>> > proj1/v1.1
>> >
>> > proj2/master
>> > proj2/v1.0
>> > proj2/v1.1
>> > proj2/v1.3
>> >
>> > How can I do that?
>> >
>> > Many thanks in advance
>> >
>> > Best Regards
>> > NoRulez
>> > --
>> >
>> > 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://www.cmake.org/mailman/listinfo/cmake
>> >
>> > --
>> >
>> > 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://www.cmake.org/mailman/listinfo/cmake
>> --
>>
>> 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://www.cmake.org/mailman/listinfo/cmake
>
>
> --
> Nicolas Desprès
>
>
> --
>
> 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://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list