Leek, Jim wrote:
> 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?

If those tests can read their input from any location keeping them in the 
source dir is the best you can do as you don't waste space and time by copying 
them.

If those input files need to be adapted for a test run, e.g. telling them the 
location of a path, the endianess, bit size, or a configuration option of the 
build you may want to have a look on configure_file(). If those scripts create 
any temporary files I think it's best to set their working dir 
(WORKING_DIRECTORY property or option) to the binary tree.  Be careful that 
those tests may be run in parallel if you run ctest -j, so make sure they 
either use different filenames or different directories.

> 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?

set_tests_properties(... PASS_REGULAR_EXPRESSION)?

Eike
-- 

Attachment: signature.asc
Description: This is a digitally signed message part.

--

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

Reply via email to