[CMake] How can I run tests using a wrapper script

EXT-York, Gantry gantry.york at boeing.com
Fri Nov 4 17:13:22 EDT 2011


I'm new to cmake.

I'm trying to define some unit tests in CMakeLists.txt.    I need to run utest1, utest2, utest3 and so forth, but I need to run them through a wrapper script called run_utest.  run_utest is used to intercept some output and report it to a website.  We do not use cdash.

I'm trying to do this with the

add_executable( utest1 )
add_test(
    NAME utest1
    COMMAND /fully/qualified/path/run_utest  --report  utest1
)

The problem is that the add_test command treats run_utest as the command but the following arguments are treated as arguments.  ctest -V even shows that they are quoted.  utest1 does not get treated as if it is an executable.

So what I get is

/fully/qualified/path/run_utest "-report" "utest1"

instead of

/fully/qualified/path/run_utest -report /path/to/utuest1

Needless to say it won't run.




Gantry York
Boeing/KinetX
Iridium SCS Development Team

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111104/45fd8d71/attachment-0001.htm>


More information about the CMake mailing list