[CMake] CDash + Perforce

David Cole david.cole at kitware.com
Wed Nov 16 14:36:56 EST 2011


Overall, it will be challenging. We prefer adding tests of all new
features, and it's difficult to add a test that runs on a sufficient
number of dashboard clients (greater than zero... :-) when the thing
you're testing depends on having / simulating a commercial tool
installed on the machine.

But adding the code shouldn't be that difficult:

Looks like perforce is what we call a "global" revision control
system, wherein there's a changeset that contains changes to multiple
files all committed atomically as one unit in the repository. If
that's the case, then we'll need a subclass of cmCTestGlobalVC for
perforce. Look at the SVN subclass (and the others, too) for clues
about what's required:

  CMake/Source/CTest/cmCTestSVN.cxx

The pure virtual methods in cmCTestGlobalVC are:

  virtual void LoadModifications() = 0;
  virtual void LoadRevisions() = 0;

Those are the two that you must implement, to run something equivalent
to 'svn status' and 'svn log' respectively, with appropriate
arguments, to analyze what's changed when an update occurs.

Then you have to make sure that ctest_update knows how to run the
equivalent of "svn up" - that's in some different code...

Actually, probably the best thing to do to understand what's required
overall is to look at the following commit, to see what Brad did to
add support for git to ctest in the  2.8 release:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9c17cbeb44f4e47dd8f6a2cda57c3967b293cdfe

Follow-up commits that also touch those files should also be inspected
to see what had to change to support different versions of git, and
different work-tree arrangements, and other bugs that popped up as it
was tested.

Let me know if you have any specific questions...


David


On Wed, Nov 16, 2011 at 1:53 PM, Robert Dailey <rcdailey at gmail.com> wrote:
> Thanks for the info David.
> If I can find the time I would love to help make these changes for you. In
> the meantime if you find the time, give me some pointers to get me started
> and I'll work on this for you (class names, interface methods that are
> important to implement, etc)
>
> ---------
> Robert Dailey
>
>
> On Wed, Nov 16, 2011 at 12:03 PM, David Cole <david.cole at kitware.com> wrote:
>>
>> On Wed, Nov 16, 2011 at 12:28 PM, Robert Dailey <rcdailey at gmail.com>
>> wrote:
>> > So basically because we use perforce, there is no way to use ctest?
>>
>> Well, you can still use ctest, you just won't be able to use the
>> ctest_update function in your script to do the update, track the
>> changed files, and communicate them up to CDash for you.
>>
>> > I assume ctest does the following:
>> > - Check out source code
>> > - Configure CMake
>> > - Generate CMake
>> > - Initiate a build from generated targets
>> > Is this correct? If so, it's the first step that code needs to be added
>> > for
>> > to support perforce?
>>
>> Yes, basically correct. Most of our dashboard scripts do check out the
>> source code if the source tree is not there, or simply update it if it
>> is there.
>>
>> > Is there a way to tell CTest to not check out source code and instead
>> > point
>> > it to an existing working copy, that way I can perform the perforce
>> > checkout
>> > externally via script? This would make for a decent workaround.
>> > Thanks.
>>
>> If there is an existing working copy, you may point at it. You can
>> even do your own checkout and update steps if you want to using
>> "execute_process" and some perforce command line... But ctest will not
>> parse the perforce results and send them to the CDash server. That's
>> what would need to be added to support perforce is a C++ class in
>> ctest that knows how to interpret the output of perforce command line
>> checkout/update steps. And in CDash, some code that knows how to form
>> links to an online repository viewer would need to be added.
>>
>> It's all do-able... just not done yet. :-)
>>
>>
>> David
>>
>>
>> > ---------
>> > Robert Dailey
>> >
>> >
>> > On Wed, Nov 16, 2011 at 11:03 AM, David Cole <david.cole at kitware.com>
>> > wrote:
>> >>
>> >> And, to answer your initial question, no, perforce is not yet an
>> >> officially supported version control system for use with ctest -S
>> >> scripts and CDash.
>> >>
>> >> The ones that are include:
>> >>  git
>> >>  svn
>> >>  cvs
>> >>  hg
>> >>  bzr
>> >>
>> >> Additional code needs to be added to both ctest and CDash in order to
>> >> support new version control systems.
>> >>
>> >>
>> >> HTH,
>> >> David
>> >>
>> >>
>> >> On Wed, Nov 16, 2011 at 12:01 PM, David Cole <david.cole at kitware.com>
>> >> wrote:
>> >> > CDash is just a web app / server app. It does not do builds, it just
>> >> > collects information from clients that submit to it, and displays
>> >> > results.
>> >> >
>> >> > Client machines can run ctest -S scripts to submit build/test results
>> >> > to a CDash dashboard.
>> >> >
>> >> > Look at the notes attached to a typical CMake dashboard for an
>> >> > example
>> >> > of how a client machine must be set up to submit to the CDash server.
>> >> >
>> >> > For example, this one:
>> >> >
>> >> >  http://www.cdash.org/CDash/viewNotes.php?buildid=1730072
>> >> >
>> >> > On our machine, dashmacmini5.kitware, a script runs this command with
>> >> > the script shown at the above link:
>> >> >
>> >> >  ctest -S
>> >> > ${HOME}/Dashboards/DashboardScripts/dashmacmini5_cmake_clang.cmake
>> >> > -O ${HOME}/Dashboards/Logs/dashmacmini5_cmake_clang.log
>> >> >
>> >> >
>> >> > HTH,
>> >> > David
>> >> >
>> >> >
>> >> > On Wed, Nov 16, 2011 at 11:55 AM, Robert Dailey <rcdailey at gmail.com>
>> >> > wrote:
>> >> >> Seems like the web viewer link is optional, I created the project
>> >> >> without
>> >> >> it.
>> >> >> However, I see the default build groups but how do I add a build? I
>> >> >> suppose
>> >> >> CDash needs to know how to do a checkout of source code from
>> >> >> Perforce?
>> >> >> I'm
>> >> >> really confused on what to do next...
>> >> >>
>> >> >> ---------
>> >> >> Robert Dailey
>> >> >>
>> >> >>
>> >> >> On Wed, Nov 16, 2011 at 10:40 AM, Robert Dailey <rcdailey at gmail.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> Is it possible to use CDash with perforce as our SCM?
>> >> >>> During the CDash installation, it is asking me for a "Repository
>> >> >>> ViewerURL", and from the drop down it doesn't show perforce as a
>> >> >>> valid
>> >> >>> item
>> >> >>> in the list. Can this step be skipped or is there some way to make
>> >> >>> perforce
>> >> >>> work with this? I believe perforce's web viewer is P4Web.
>> >> >>> Thanks.
>> >> >>>
>> >> >>> ---------
>> >> >>> Robert Dailey
>> >> >>
>> >> >>
>> >> >> --
>> >> >>
>> >> >> 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