[CMake] add_test with large input files

Olivier Pierard olivier.pierard at cenaero.be
Thu Dec 17 11:07:16 EST 2009


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
BELGIUM 

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

http://www.cenaero.be/

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

http://www.cenaero.be/disclaimer



More information about the CMake mailing list