-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AdditionalResolutionDirectories for console app #48
base: Revit2017
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -378,8 +378,6 @@ public Runner() | |
/// <param name="setupData"></param> | ||
public Runner(IRunnerSetupData setupData) | ||
{ | ||
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ReflectionOnlyAssemblyResolve; | ||
|
||
if (!String.IsNullOrEmpty(setupData.TestAssembly) && !File.Exists(setupData.TestAssembly)) | ||
{ | ||
throw new ArgumentException("The specified test assembly does not exist."); | ||
|
@@ -428,6 +426,20 @@ public Runner(IRunnerSetupData setupData) | |
IsTesting = setupData.IsTesting; | ||
ExcludedCategory = setupData.ExcludedCategory; | ||
|
||
if(!string.IsNullOrEmpty(setupData.AdditionalResolutionDirectories)) | ||
{ | ||
var splits = setupData.AdditionalResolutionDirectories.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); | ||
if (!splits.Any()) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is better to throw an exception to let users know there is an error |
||
|
||
this.AdditionalResolutionDirectories.Clear(); | ||
foreach (var split in splits) | ||
{ | ||
this.AdditionalResolutionDirectories.Add(split); | ||
} | ||
} | ||
var resolver = new DefaultAssemblyResolver(RevitPath, AdditionalResolutionDirectories); | ||
AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += resolver.Resolve; | ||
|
||
Initialize(); | ||
} | ||
|
||
|
@@ -1784,6 +1796,7 @@ public static IRunnerSetupData ParseCommandLineArguments(IEnumerable<string> arg | |
{"exclude:", "The name of a test category to exclude. This has a higher priortiy than other settings. If a specified category is set here, any test cases that belongs to that category will not be run. (OPTIONAL)", v=> setupData.ExcludedCategory = v}, | ||
{"c|concatenate", "Concatenate the results from this run of RTF with an existing results file if one exists at the path specified. The default behavior is to replace the existing results file. (OPTIONAL)", v=> setupData.Concat = v != null}, | ||
{"revit:", "The Revit executable to be used for testing. If no executable is specified, RTF will use the first version of Revit that is found on the machine using the RevitAddinUtility. (OPTIONAL)", v=> setupData.RevitPath = v}, | ||
{"add:", @"Additional path resolution directories as a string separated by ';'", v=>setupData.AdditionalResolutionDirectories=v}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor. But how about additionalDirs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was looking for some smaller name, maybe I can call it "paths:" |
||
{"copyAddins", "Specify whether to copy the addins from the Revit folder to the current working directory. Copying the addins from the Revit folder will cause the test process to simulate the typical setup on your machine. (OPTIONAL)", | ||
v=> setupData.CopyAddins = v != null}, | ||
{"dry", "Conduct a dry run. (OPTIONAL)", v=> setupData.DryRun = v != null}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type shoud be List
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ";" separated list of path into one string, so that OptionSet can work seamlessly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see that you mean to pass multiple directories in one string separated by ";".