0

CTest can be run within the build folder using ctest -V, is there an equally simple command to re-run all the tests outside of the build folder?

I am not asking about running it inside the build process. I would like to re-run all the tests somewhere else using the command line.

I naively tried:

ctest -V /opt/geophase/build/
UpdateCTestConfiguration  from :Projects/research/openfoam/geophase/singularity/geophase/DartConfiguration.tcl
UpdateCTestConfiguration  from :Projects/research/openfoam/geophase/singularity/geophase/DartConfiguration.tcl
Test project Projects/research/openfoam/geophase/singularity/geophase
Constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
No tests were found!!!

But if I run "ctest -V" in "/opt/geophase/build" all tests run.

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
tmaric
  • 5,347
  • 4
  • 42
  • 75
  • I'm not sure that capability exists today. You could try using the CTest's [Build and Test](https://cmake.org/cmake/help/latest/manual/ctest.1.html#build-and-test-mode) mode, and assuming your tests are already built, the build stage will complete quickly and your tests can run. – Kevin Mar 09 '20 at 12:50
  • I just do `( cd /opt/geophase/build && ctest -V )` or `sh -c 'cd "$0" && ctest -v "$@"' '/opt/geophase/build'` – KamilCuk Mar 09 '20 at 12:55
  • I just noticed this writes all the output files of my applicaitons in the original build folder. Can I redirect output to the folder where I run `cmake --build ...` command? – tmaric Mar 09 '20 at 14:10

0 Answers0