0

I have a large supporting file placed in another location outside my test Working directory.

Working Directory = C:/cmake/src/Test

Large Binary file to be parsed = C:/Largefiles/Binary.fft

I dont want to copy Binary.fft to C:/cmake/src/Test

set(working_dir "C:/cmake/src/Test")

set(Large_Binary "C:/Largefiles/")

Is it possible to do specify two working directories for a test like this?

set_tests_properties(Test_Large PROPERTIES ENVIRONMENT PATH=${BIN_DIR} WORKING_DIRECTORY ${working_dir }${Large_Binary })

Or is there a better way to approach this situation?

arun
  • 72
  • 8
  • `WORKING_DIRECTORY` will be a *current directory* when test executable is called. Obviously, you cannot have several directories to be a current at once. For test being able to locate files from several directories, you may setup some environment variables to contain these directories, and read these variables within a test. – Tsyvarev Sep 05 '18 at 14:31
  • Thank you for the valuable answer. My source files currently read the file locations by path using . I tried to point that using **%CD%/Largefiles**. It is not resolving the current directory. You have any suggestions/recommendation in this case. – arun Sep 06 '18 at 05:25
  • What is `%CD%` construction? Common usage of current directory is that you can refer a file under that directory using its *relative path*. E.g. if you have directory `C:/cmake/src/Test` to be current one, and want to access the file `C:/cmake/src/Test/Images/image.jpg`, then you may refer to that file as `Images/image.jpg`. – Tsyvarev Sep 06 '18 at 07:32

0 Answers0