diff options
author | Matt Ward <matt.ward@xamarin.com> | 2017-11-22 18:15:01 +0300 |
---|---|---|
committer | Matt Ward <matt.ward@xamarin.com> | 2017-11-22 18:15:01 +0300 |
commit | 529eb57464b30ccc7a029ae4e9c34433ba5f7bb3 (patch) | |
tree | 3c83ad8e4d704c98b5ae0b14723b26834aa8c187 /main/src/addins/MonoDevelop.UnitTesting | |
parent | 1db027f7da755aecda6029339f793562c812d10b (diff) |
[UnitTesting] Ensure projects are disposed after running tests
This ensures the file watcher is disposed which should prevent the
unit tests from not finishing.
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r-- | main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs index a4b8456a88..61a118429c 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs @@ -32,6 +32,8 @@ namespace MonoDevelop.UnitTesting.Tests [TestFixture()] public class BasicTests : TestBase { + Solution sol; + [TestFixtureSetUp] public void Start() { @@ -40,6 +42,15 @@ namespace MonoDevelop.UnitTesting.Tests IdeApp.Workspace.ActiveConfigurationId = "Debug"; } + [TearDown] + public override void TearDown () + { + sol?.Dispose (); + sol = null; + + base.TearDown (); + } + [Test()] public async Task TestsXUnitDotNetFull() { @@ -64,7 +75,7 @@ namespace MonoDevelop.UnitTesting.Tests Assert.IsTrue(process.WaitForExit(60000), "Timeout restoring nuget packages."); Assert.AreEqual(0, process.ExitCode); - var sol = await Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile) as Solution; + sol = await Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solFile) as Solution; Assert.AreEqual(0, (await sol.Build(Util.GetMonitor(), "Debug")).ErrorCount); var project1 = sol.GetAllProjects().Single(p => p.Name == projectName); var rootUnitTest1 = UnitTestService.BuildTest(project1) as UnitTestGroup; |