[CMake] Some ctest question

Leek, Jim leek2 at llnl.gov
Wed May 15 20:35:31 EDT 2013


I'm new to cmake, a few weeks ago I decided to convert a complex and decrepit old build system to cmake. It has gone very well, I'm quite impressed.

So, now I want to add testing support, but I haven't been able to figure out a few things.


1.      What to do with testing input files?  I wrote a script to handle the common details of running.  So I just need to pass it paths to the executable and input files.  What's the best way to do this?  Right now I just have them point to the source directory, is that the best way to handle this?

add_test (Bungee ${PROJECT_SOURCE_DIR}/Examples/psuade_2test.sh ${PROJECT_BINARY_DIR}/psuade ${PROJECT_SOURCE_DIR}/Examples/Bungee/psuade.in ${PROJECT_SOURCE_DIR}/Examples/Bungee/psScript.in ${PROJECT_SOURCE_DIR}/Examples/Bungee/psScript.out)

Maybe it would be better to copy the input files to the build directory?


2.      Also, with autoconf you can run installcheck.  However, I'm sure what I did here wouldn't work with an installcheck.  However, I can't find any evidence that cmake supports installcheck explicitly.  Does it? And if so, what's the right way to do it?


3.      Finally, my testing script uses "diff" to compare the output from the test to the canonical output.  This works fine on various unix flavors, but I will also need to build this on Windows (probably with mingw).  Windows doesn't have diff, but does have FC.  I could probably write a windows script to do testing.  How are these problems usually handled?  CMAKE_SYSTEM_NAME?

Thanks,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130516/a4f3a834/attachment.htm>


More information about the CMake mailing list