Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

data directory relative to SolutionDir
tofutim
#1 Posted : Monday, December 30, 2013 10:30:52 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/27/2012(UTC)
Posts: 19
Location: California

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
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?
tofutim
#2 Posted : Friday, January 3, 2014 9:22:17 PM(UTC)
Rank: Member

Groups: Registered
Joined: 8/27/2012(UTC)
Posts: 19
Location: California

Thanks: 2 times
Was thanked: 2 time(s) in 2 post(s)
Remco
#3 Posted : Friday, January 3, 2014 10:32:23 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.024 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download