MantisBT - CMake
View Issue Details
0013302CMakeCTestpublic2012-06-13 21:052013-03-04 08:38
Jean-Christophe Fillion-Robin 
David Cole 
normalfeatureN/A
closedfixed 
 
CMake 2.8.9CMake 2.8.9 
0013302: Improve mechanism allowing to pass command line parameter to ctest script
When setting up dashboard it is sometimes useful to pass parameter to ctest script.

A possible approach is to pass parameters doing the following:

  ctest -S /path/to/script.cmake,OPTNAME1##OPTVALUE1^^OPTNAME2##OPTVALUE2

Then, the following code can be used in the called CTest script to "extract" the associated value:

if(NOT CTEST_SCRIPT_ARG STREQUAL "")
  string(REPLACE "^^" "\\;" CTEST_SCRIPT_ARG_AS_LIST "${CTEST_SCRIPT_ARG}")
  set(CTEST_SCRIPT_ARG_AS_LIST ${CTEST_SCRIPT_ARG_AS_LIST})
  foreach(argn_argv ${CTEST_SCRIPT_ARG_AS_LIST})
    string(REPLACE "##" "\\;" argn_argv_list ${argn_argv})
    set(argn_argv_list ${argn_argv_list})
    list(GET argn_argv_list 0 argn)
    list(GET argn_argv_list 1 argv)
    set(${argn} ${argv})
  endforeach()
endif()

When more complex value, like URL are passed as parameter, special characters like ":" need also to be "encoded". See issue 0012953

A mechanism similar to what's done with "cmake" executable could probably be implemented. It means parameter could be passed using:
   -DOPTNAME1:STRING=OPTVALUE1
 
No tags attached.
Issue History
2012-06-13 21:05Jean-Christophe Fillion-RobinNew Issue
2012-08-11 21:42David ColeStatusnew => backlog
2012-08-11 21:42David ColeNote Added: 0030438
2012-09-03 16:55Rolf Eike BeerNote Added: 0030901
2012-09-03 17:17David ColeAssigned To => David Cole
2012-09-03 17:17David ColeStatusbacklog => assigned
2012-09-03 17:17David ColeNote Added: 0030903
2012-09-03 17:17David ColeStatusassigned => resolved
2012-09-03 17:17David ColeFixed in Version => CMake 2.8.9
2012-09-03 17:17David ColeResolutionopen => fixed
2012-09-03 17:18David ColeTarget Version => CMake 2.8.9
2013-03-04 08:38Robert MaynardNote Added: 0032449
2013-03-04 08:38Robert MaynardStatusresolved => closed

Notes
(0030438)
David Cole   
2012-08-11 21:42   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0030901)
Rolf Eike Beer   
2012-09-03 16:55   
Hasn't this been fixed by the ctest-cmd-line-vars topic that went into 2.8.9?
(0030903)
David Cole   
2012-09-03 17:17   
Yes, Eike -- thanks for pointing that out.... this is resolved. See the ctest command line help starting in version 2.8.9 -- -D is now supported for defining variable values on the ctest command line when running a ctest -S script.
(0032449)
Robert Maynard   
2013-03-04 08:38   
Closing resolved issues that have not been updated in more than 4 months.