[CMake] CTest and GIT

Bill Hoffman bill.hoffman at kitware.com
Wed Mar 5 10:39:23 EST 2008


Brad King wrote:
> David Cole wrote:
>> With this declarative style script, the inner ctest run via
>> CTEST_COMMAND will use the CVSCOMMAND cache entry... CTEST_CVS_COMMAND
>> is used when you use the CTEST_UPDATE() command within a command-based
>> script (as opposed to a declarative script). Try adding:
>>
>> CVSCOMMAND:STRING=/usr/bin/git-clone
>>
>> to the cache section of your script and see if that changes it...
> 
> I don't think that will work because git doesn't work that way.
> 
>> On 3/5/08, *Andreas Schneider* <mail at cynapses.org
>> <mailto:mail at cynapses.org>> wrote:
>>     has someone CTest running with git? I can clone the repository, but
>>     it always
>>     tries to use cvs to update. See attached config file.
> 
> CTest has hard-coded support for CVS and SVN update rules because it
> parses the output of the update command to report what changes were
> obtained.  Someone will have to edit the source file
> 
>   CMake/Source/CTest/cmCTestUpdateHandler.cxx
> 
> to add explicit git support.
> 
> Coincidentally I was just starting to look at doing this in my spare
> time last weekend, though I haven't actually produced code yet.  Since
> git supports so many different ways of updating (fetch/merge,
> fetch/rebase, multiple remotes with multiple branches, etc.) we will
> have to teach CMake something new about configurable/custom update
> rules.  I'm still thinking about how this might work.
> 
> Collecting nightly changes on a given branch (either local or remote)
> can be done with git-rev-list's --until and --since options.  Then from
> those sha1s we can ask git for the log messages and lists of files changed.
> 
> I don't know when I'll get back to working on this.  If you have any
> suggestions feel free to post them or email me off list.
> 

That said, you could most likely "hack" support for GIT into a ctest 
script.  Basically, set the CVS and SVN commands to some sort of no-op 
command.  Then, use execute_process to run the git commands to get the 
version of the software you want.  You would have empty update sections 
on CDash, but the basic stuff would work.  The other option would be to 
create a shell script that simulates cvs or svn via git....

-Bill


More information about the CMake mailing list