Hi,

The documentation states that the add_test() WORKING_DIRECTORY option will run the test in the given directory. This add_test rule in my CMakeLists.txt file:

add_test(
  NAME bwr_melgen
  WORKING_DIRECTORY ${Bwr_Dir}
  COMMAND melgen.x ${Bwr_Dir}/_BWR_v2-0.inp
)

with ${Bwr_Dir} == /scratch/trunk_tests/_ShorterRuns/Plant_Decks/BWR

results in this command line.

1: Test command: /scratch/trunk/tools/melgen.x /scratch/trunk_tests/ _ShorterRuns/Plant_Decks/BWR/_BWR_v2-0.inp
  Test #1: bwr_melgen

Due to problems in the code base, the output is not generated in the test directory and this is a known code problem.

Is there an easy way to change the WORKING_DIRECTORY behavior to have it always cd to the working directory beforehand, then run the test, (pushd / popd behavior) etc..., rather than making, in our case the unsafe assumption, that the program correctly writes the files where they should be? Frankly, if ctest would always cd into the test directory, then we'd never have a problem though we would never uncover the incorrect file handling behavior either.

Anyone know of a way to change the working directory behavior?

-- Noel


_______________________________________________
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