Browse Source

Avoid test failure on build server when unit tests for several branches are running concurrently.

pull/14/head
Daniel Grunwald 15 years ago
parent
commit
84ed7ca178
  1. 27
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/EditOperationTests.cs

27
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/Designer/EditOperationTests.cs

@ -1,16 +1,41 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Threading;
using System.Windows; using System.Windows;
using NUnit.Framework;
using ICSharpCode.WpfDesign.Designer.Xaml; using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.XamlDom; using ICSharpCode.WpfDesign.XamlDom;
using NUnit.Framework;
namespace ICSharpCode.WpfDesign.Tests.Designer namespace ICSharpCode.WpfDesign.Tests.Designer
{ {
[TestFixture] [TestFixture]
public class EditOperationTests : ModelTestHelper public class EditOperationTests : ModelTestHelper
{ {
Mutex mutex;
[TestFixtureSetUp]
public void FixtureSetUp()
{
// Avoid test failure on build server when unit tests for several branches are run concurrently.
bool createdNew;
mutex = new Mutex(true, "ClipboardUnitTest", out createdNew);
if (!createdNew) {
if (!mutex.WaitOne(10000)) {
throw new Exception("Could not acquire mutex");
}
}
}
[TestFixtureTearDown]
public void FixtureTearDown()
{
mutex.ReleaseMutex();
mutex.Dispose();
}
[Test] [Test]
public void Cut() public void Cut()
{ {

Loading…
Cancel
Save