Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Laval <jeremie.laval@gmail.com>2018-10-12 17:11:23 +0300
committerJérémie Laval <jeremie.laval@gmail.com>2018-10-15 18:15:52 +0300
commit7a4f8044f80f3957fd1b7bd43f11e8583af1e3de (patch)
tree4c199c0ffa956744276ddad73d10ba2d918f48e6 /main/src/addins/MonoDevelop.UnitTesting.NUnit
parent01d1cce4a30139bde41c951d2b100283494ac96f (diff)
[NUnit] Add configuration option to disable support assembly loading
The current logic for `IsSupportAssembly` doesn't take into account PackageReference binaries quite well since it cannot accurately determine with the availble information if such a reference will end up being copied to the output directory or not. This causes a lot of assemblies to be loaded in the running process mistakenly which in our case cause AssemblyLoad errors to happen. This commit adds a workaround for now in the form of a project configuration option (set as a .csproj MSBuild property) to disable the current logic and essentially count on the fact that the necessary dependency closure for the tests are already being properly copied out by the build logic.
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting.NUnit')
-rw-r--r--main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs
index 1e733711a4..25cd157320 100644
--- a/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs
+++ b/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitProjectTestSuite.cs
@@ -212,6 +212,10 @@ namespace MonoDevelop.UnitTesting.NUnit
protected override async Task<IEnumerable<string>> GetSupportAssembliesAsync ()
{
if (project != null) {
+ // Check to see if the project doesn't want to have support assemblies loaded (e.g. if it ensures every dependency is available in the output folder)
+ if (project.ProjectProperties.GetValue ("NUnitDisableSupportAssemblies", false))
+ return Enumerable.Empty<string> ();
+
var references = await project.GetReferences (IdeApp.Workspace.ActiveConfiguration).ConfigureAwait (false);
// Referenced assemblies which are not in the gac and which are not localy copied have to be preloaded
var supportAssemblies = new HashSet<string> ();