Explicitly set working directory for automation tests
- MatterSlice not found: IssueMatterHackers/MCCentral#612
This commit is contained in:
parent
4b2c0740bb
commit
aa6f2a539f
1 changed files with 12 additions and 0 deletions
|
|
@ -354,12 +354,24 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
QueueTemplate queueItemFolderToAdd = QueueTemplate.None,
|
||||
int overrideWidth = -1, int overrideHeight = -1)
|
||||
{
|
||||
// Walk back a step in the stack and output the callers name
|
||||
StackTrace st = new StackTrace(false);
|
||||
Debug.WriteLine("\r\n ***** Running automation test: {0} {1} ", st.GetFrames().Skip(1).First().GetMethod().Name, DateTime.Now);
|
||||
|
||||
if (staticDataPathOverride == null)
|
||||
{
|
||||
// Popping one directory above MatterControl, then back down into MatterControl ensures this works in MCCentral as well and MatterControl
|
||||
staticDataPathOverride = TestContext.CurrentContext.ResolveProjectPath(5, "MatterControl", "StaticData");
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
string outputDirectory = "Debug";
|
||||
#else
|
||||
string outputDirectory = "Release";
|
||||
#endif
|
||||
|
||||
Environment.CurrentDirectory = TestContext.CurrentContext.ResolveProjectPath(5, "MatterControl", "bin", outputDirectory);
|
||||
|
||||
#if !__ANDROID__
|
||||
// Set the static data to point to the directory of MatterControl
|
||||
StaticData.Instance = new FileSystemStaticData(staticDataPathOverride);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue