[CMake] Get ctest -S script to pull from git branch other than 'master'?

Bartlett, Roscoe A rabartl at sandia.gov
Tue Jun 7 17:04:17 EDT 2016


Hello,

Is there a built-in way to get a ctest -S script to checkout and pull from a git branch other than 'master'?  I can't seem to find a way to so this and there is no mention of branches at all in the official documentation:

    https://cmake.org/cmake/help/v3.6/command/ctest_update.html?highlight=ctest_update

and there is no mention of "branch" at:

    https://cmake.org/Wiki/CMake/Testing_With_CTest

Currently, I see code that people have written which is explicitly checking out and updating the desired branch after ctest_update() is called (e.g. this what TribitsCTestDriverCore.cmake does).  Therefore, this CTest code is really just using ctest_update() to do a `git fetch` on the external repo.  In this case, if the local branch is changed to a tracking branch, then will ctest_update() leave that tracking branch as is and just pull from the tracking branch the next time the ctest -S script is called?  If that is the case, then I would expect CTest to report the correct list of "updated files".  But if ctest_update() instead switches back to the 'master' branch and then does the pull, then it will likely report the wrong list of "updated files".

I can dig into the source code for CTest to see what it actually does but it would be nice to have direct support for choosing the branch or at the very least just documenting the current behavior and describe the best way to work around the issue.

Thanks,

-Ross


Dr. Roscoe A. Bartlett, PhD
Sandia National Laboratories
Trilinos Software Engineering and Integration Technologies Lead
Consortium for the Advanced Simulation of Light Water Reactors (CASL) Physics Integration Infrastructure Lead

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160607/9cb2ae4e/attachment.html>


More information about the CMake mailing list