[CMake] Dart and tests

David Cole david.cole at kitware.com
Fri Nov 9 10:47:26 EST 2007


Have a look at the recently committed "CMake/Tests/Tutorial/Step7" project
in CVS CMake. (Update to current CVS CMake, it was just committed
yesterday.)

If you do a diff between "CMake/Tests/Tutorial/Step6" and
"CMake/Tests/Tutorial/Step7", it will demonstrate to you the minimum steps
required to add ctest dashboard support to a project.

It essentially boils down to this:

CMake/Tests/Tutorial/Step7:
===========================
Minimal steps necessary to drive dashboard builds of your project with
CTest:
  Add to your CMakeLists.txt file:
    INCLUDE(CTest)

  Add a file named "CTestConfig.cmake" to your source tree containing at
least:
    SET(CTEST_PROJECT_NAME "Tutorial")
      #
      # The name used here should match the name used in the first PROJECT
      # command in your top level CMakeLists.txt.

  And now write either (1) or (2):

    (1) an old style ctest -S dashboard script "build1.cmake" that contains
at least:

    SET(CTEST_SOURCE_DIRECTORY "C:/Dashboards/My
Tests/CMake/Tests/Tutorial/Step7")
    SET(CTEST_BINARY_DIRECTORY "C:/Dashboards/My Tests/Step7-build1")

    SET(CTEST_CMAKE_COMMAND "cmake")
    SET(CTEST_COMMAND "ctest -D Experimental")
      #
      # In this "old style" ctest -S dashboard script,
      # CTEST_CMAKE_COMMAND is used to configure CTEST_SOURCE_DIRECTORY
      # into CTEST_BINARY_DIRECTORY. After configuring is done,
CTEST_COMMAND
      # is used to run the remaining phases of the dashboard. It is a good
      # idea to use full path names for cmake and ctest rather than simply
      # "cmake" and "ctest"

    (2) a "new style" ctest -S dashboard script "build2.cmake" that contains
at least:

    SET(CTEST_SOURCE_DIRECTORY "C:/Dashboards/My
Tests/CMake/Tests/Tutorial/Step7")
    SET(CTEST_BINARY_DIRECTORY "C:/Dashboards/My Tests/Step7-build2")
    SET(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005")

    CTEST_START("Experimental")
    CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}")
    CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}")
    CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}")
    CTEST_SUBMIT()
      #
      # In this "new style" ctest -S dashboard script, the ctest that is
driving
      # the script is the same as the cmake/ctest used to execute the
dashboard
      # steps. Hence, full path names to cmake/ctest are inferred when using
this
      # style of script.

  Run the following commands to execute each dashboard script:

    ctest -VV -S build1.cmake

    ctest -VV -S build2.cmake



Hope this helps,
David




On 11/9/07, Vitor Vasconcelos Araujo Silva <vasconcv at loria.fr> wrote:
>
>         Hello guys,
>
>         Sorry to disturbe you with a probably simple subject, but I got
> lost
> with too many information.
>         Let's start:
>         I have my set of CMakeLists.txt to all project working fine. Now I
> want
> to send my tests to a Dart sever creating my dashboard. I have my
> Mastering CMake opened in session 8.7 (Producing Test Dashboards) and
> the first thing it says: INCLUDE(Dart).
>         At this moment, I have in my browser:
>
> http://www.cmake.org/Wiki/CMake_Testing_With_CTest
>
>         and
>
> http://www.cmake.org/Wiki/CMake_Scripting_Of_CTest#CTest_Scripting
>
>         The Testing with Ctest wiki says me to include CTest. This was my
> first
> point of confusion. No problem, I just followed the reply from Alexander
> Neundorf (Thanks Alexander!) and included CTest.
>
>         After make sure my CMakeLists.txt works fine without
> INCLUDE(CTest),
> after include it I got the following messages:
>
> -- Cannot determine repository type. Please set UPDATE_TYPE to 'cvs' or
> 'svn'. CTest update will not work.
> CMake Error: Error in cmake code at
> /usr/local/share/cmake-2.4/Modules/CTestTargets.cmake:6:
> FILE problem creating directory: /Testing/Temporary
> Current CMake stack:
> [3]     /usr/local/share/cmake-2.4/Modules/CTestTargets.cmake
> [2]     /usr/local/share/cmake-2.4/Modules/CTest.cmake
> [1]     /users/qgar/vasconcv/work/Qgar/qgarlib/vitorsuite/CMakeLists.txt
> CMake Error: Could not open file for write in copy operation
> /DartConfiguration.tcl.tmp
> CMake Error: : System Error: Permission denied
> CMake Error: Error in cmake code at
> /usr/local/share/cmake-2.4/Modules/CTestTargets.cmake:20:
> CONFIGURE_FILE Problem configuring file
> Current CMake stack:
> [3]     /usr/local/share/cmake-2.4/Modules/CTestTargets.cmake
> [2]     /usr/local/share/cmake-2.4/Modules/CTest.cmake
> [1]     /users/qgar/vasconcv/work/Qgar/qgarlib/vitorsuite/CMakeLists.txt
> -- /usr/local/lib/libqgar.a
> --
> -- FreemanChainTest.cpp
> -- GenArcTest.cpp
> -- Configuring done
> Exit 255
>
>         I didn't tried before the "ccmake". I have both CMake 2.4.3 and
> 2.4.7
> in the same server and as ccmake was not built in the newer version, I'm
> trying to avoid to use it *supposing* it's deprecated.
>
>         So, I have these 4 errors (as long as I understood the message):
>
>         1) problem to create a temporary directory
>         Well, I'm using my account and I have permission to write on it.
> So, I
> don't understand why I got this error.
>
>         2) Cannot open file for write (DartConfiguration.tcl.tmp). Where
> is it
> supposed to be written?
>
>         3) Ok, permission problem...
>
>         4) And a problem to configure file.
>
>         I guess all errors are related to the same problem, this
> permission I
> must give to cmake to write the files it needs. So, can you clarify what
> directories CMake needs to access (open and write)? I'll need to explain
> that to my system admin.
>
>         Going far, after having my CMakeLists.txt working fine, with
> INCLUDE(CTest), what are the steps to generate and send information to
> Dart Server? The Mastering CMake says is enough to do: ctest -D
> Experimental. Is it enough? I'm supposing here to send to the default
> Dash server without any customization.
>
>         Thanks a lot guys and hope I could explain well in english...
>
> --
>         Vitor VASCONCELOS
>         Projet QGAR
>         LORIA / INRIA-Lorraine
>         Campus Scientifique, BP 239
>         54506, Vandoeuvre-lès-Nancy, FRANCE
>         Tel: +33 (0)3 54 95 85 76
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20071109/1dbcdb04/attachment.html


More information about the CMake mailing list