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:
authorMarius Ungureanu <marius.ungureanu@xamarin.com>2016-09-23 16:32:03 +0300
committerMarius Ungureanu <marius.ungureanu@xamarin.com>2016-09-23 16:32:05 +0300
commit18c56eaf4975a23da897596216dceacbec146996 (patch)
tree015a730967d290d98d12a67e73f3883876e1185c
parentd5964477debf75cd7a26eb615504da1d40b63c68 (diff)
[MSBuild] Fix the tests so it sets env var on fixture setup.
This more closely mimicks XS behaviour which doesn't really change its env vars during usage. That way we fix the tests that would've failed with a static dictionary cache.
-rw-r--r--main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs22
1 files changed, 8 insertions, 14 deletions
diff --git a/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs b/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
index 400476d20c..3ca18aefa0 100644
--- a/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
+++ b/main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
@@ -44,6 +44,14 @@ namespace MonoDevelop.Projects
[TestFixture]
public class MSBuildTests : TestBase
{
+ [TestFixtureSetUp]
+ public void SetUp ()
+ {
+ string dir = Path.GetDirectoryName (typeof (Project).Assembly.Location);
+ Environment.SetEnvironmentVariable ("HHH", "EnvTest");
+ Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
+ }
+
[Test ()]
public async Task LoadSaveBuildConsoleProject ()
{
@@ -425,10 +433,6 @@ namespace MonoDevelop.Projects
//[Ignore ("xbuild bug. It is not returning correct values for evaluated-items-without-condition list")]
public async Task SaveItemsWithProperties ()
{
- string dir = Path.GetDirectoryName (typeof (Project).Assembly.Location);
- Environment.SetEnvironmentVariable ("HHH", "EnvTest");
- Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
-
string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln");
Solution sol = await Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution;
var p = (DotNetProject)sol.GetAllProjects ().First ();
@@ -445,10 +449,6 @@ namespace MonoDevelop.Projects
[Test]
public async Task SaveItemsWithProperties2 ()
{
- string dir = Path.GetDirectoryName (typeof (Project).Assembly.Location);
- Environment.SetEnvironmentVariable ("HHH", "EnvTest");
- Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
-
string projFile = Util.GetSampleProject ("property-save-test", "property-save-test.csproj");
Project p = await Services.ProjectService.ReadSolutionItem (Util.GetMonitor (), projFile) as Project;
@@ -465,8 +465,6 @@ namespace MonoDevelop.Projects
public async Task EvaluateProperties ()
{
string dir = Path.GetDirectoryName (typeof (Project).Assembly.Location);
- Environment.SetEnvironmentVariable ("HHH", "EnvTest");
- Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln");
Solution sol = await Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution;
@@ -499,10 +497,6 @@ namespace MonoDevelop.Projects
[Test]
public async Task EvaluatePropertiesWithConditionalGroup ()
{
- string dir = Path.GetDirectoryName (typeof (Project).Assembly.Location);
- Environment.SetEnvironmentVariable ("HHH", "EnvTest");
- Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
-
string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln");
Solution sol = await Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution;
var p = (DotNetProject)sol.GetAllProjects ().First ();