add_test with large input files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

add_test with large input files

Olivier Pierard
Dear all,

Once again, I need your precious help !

I'm trying to convert my test suite to one suitable for CMake/CTest.

My executable for the tests is the major target of the CMake project.
Running a testcase requires an input file, which is always 'input.dat',
each one stored in a different subfolder.  These input.dat files contain
relative paths to other files (e.g.: a Finite Element mesh; that's why I
don't want to copy these files).  So I adopted the following structure:
- Project Root
    - Src
    - Validations/Test1
    - build
/Instead of:
/- Project Root
    - Src
    - Src/Validations/Test1
    - build/

I expected to use as working directory the Validations/Test1 folder (so
that I keep the Src folder clean) so that input files and dependent
files could be found.  But, of course, it's running in the
build/Validations folder.

How could I manage this ?  Is there a way to define the working
directory for tests ?
An ugly solution could be the creation of symbolic links but I cannot
imagine this is the right way to deal with input files; and I'm not sure
it's portable on Windows.

Thank you very much for your help !!!

Olivier Pierard

CENAERO, Virtual Manufacturing Group

Bâtiment EOLE, 1er étage
Rue des Frères Wright, 29
B-6041 Gosselies

Tel: +32.(0)71.919374
Fax: +32.(0)71.919370

+-+-+- Disclaimer +-+-+-

Powered by

Visit other Kitware open-source projects at

Please keep messages on-topic and check the CMake FAQ at:

Follow this link to subscribe/unsubscribe: