Build/Test Issues

data directory relative to SolutionDir

Started by tofutim on 6,295 views

This is a bit tricky. I have a rather large datafile (~100MB) that resides in my SolutionDir. In my current setup, my solution sits on a shared drive (z: = \\vmware-host\Shared Folders). However, NCrunch is run in the C: drive. I don't want to give my tests an absolute file, but rather a relative path. How can I do this - since the test gets run in C:?

I guess what I'm looking for is how can I transmit the SolutionDir to the test?

Edited

The sln is http://forum.ncrunch.net/yaf_postst1113_NCrunch-OriginalSolutionPath-vs--NCrunchOriginalSolutionDir.aspx
Hi - Yes, the answer is to use the NCrunchFramework.GetOriginalSolutionPath method to obtain the original path to the solution.

In theory, you can also include the datafile in the additional files to include setting, in which case you can access it from a relative path and it will be copied to every workspace. This approach is more conventional but a 100MB data file will greatly increase the size of your workspaces and will slow down the engine on its first pass through your solution.

Post a reply

Log in to reply.