-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PTAL] add a commandLine flag for specifying geometryLib path (#9949)
* do not recurse during product lookup remove RSA (need to use flag) add flag for passing ASM path to command line args add overload to use flag when present to sandbox,cli,cliwpf * continue to recurse for most flexible sandbox * add RSA back * review comments * add some simple tests refactor for testing modify docs from review * fix parsing of flags * use a new process in test to avoid testing the wrong thing sandbox should still start even if path is invalid asm path * review comments
- Loading branch information
1 parent
60ad7ef
commit 1d49129
Showing
8 changed files
with
201 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using Dynamo.Applications; | ||
using NUnit.Framework; | ||
|
||
namespace IntegrationTests | ||
{ | ||
public class DynamoApplicationTests | ||
{ | ||
[Test] | ||
public void DynamoSandboxLoadsASMFromValidPath() | ||
{ | ||
var versions = new List<Version>(){ | ||
new Version(224, 4, 0), | ||
new Version(224, 0, 1), | ||
new Version(223, 0, 1), | ||
new Version(225, 0, 0) }; | ||
|
||
|
||
//go get a valid asm path. | ||
var locatedPath = string.Empty; | ||
var coreDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); | ||
Process dynamoSandbox = null; | ||
|
||
DynamoShapeManager.Utilities.GetInstalledAsmVersion2(versions, ref locatedPath, coreDirectory); | ||
try | ||
{ | ||
Assert.DoesNotThrow(() => | ||
{ | ||
// we use a new process to avoid checking against previously loaded | ||
// asm modules in the nunit-agent process. | ||
dynamoSandbox = System.Diagnostics.Process.Start(Path.Combine(coreDirectory, "DynamoSandbox.exe"), $"-gp \"{locatedPath}\""); | ||
dynamoSandbox.WaitForInputIdle(); | ||
|
||
var firstASMmodulePath = string.Empty; | ||
foreach (ProcessModule module in dynamoSandbox.Modules) | ||
{ | ||
if (module.FileName.Contains("ASMAHL")) | ||
{ | ||
firstASMmodulePath = module.FileName; | ||
break; | ||
} | ||
} | ||
//assert that ASM is really loaded from exactly where we specified. | ||
Assert.AreEqual(Path.GetDirectoryName(firstASMmodulePath), locatedPath); | ||
}); | ||
} | ||
finally | ||
{ | ||
|
||
dynamoSandbox?.Kill(); | ||
|
||
} | ||
} | ||
|
||
[Test] | ||
public void IfASMPathInvalidExceptionNotThrown() | ||
{ | ||
var asmMockPath = @"./doesNotExist/"; | ||
Assert.DoesNotThrow(() => | ||
{ | ||
var model = Dynamo.Applications.StartupUtils.MakeModel(true, asmMockPath); | ||
Assert.IsNotNull(model); | ||
}); | ||
|
||
} | ||
[Test] | ||
public void GetVersionFromASMPath_returnsFileVersionForMockdll() | ||
{ | ||
var version = DynamoShapeManager.Utilities.GetVersionFromPath(@"./", "DynamoCore*.dll"); | ||
var thisVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; | ||
Assert.AreEqual(version.Major, thisVersion.Major); | ||
Assert.AreEqual(version.Minor, thisVersion.Minor); | ||
Assert.AreEqual(version.Build, thisVersion.Build); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters