improved Linux support for tests.

This commit is contained in:
Keivan Beigi 2013-04-29 17:04:14 -07:00
commit 3162e4864d
20 changed files with 178 additions and 149 deletions

View file

@ -1,11 +1,11 @@
using NUnit.Framework;
namespace NzbDrone.Test.Common
namespace NzbDrone.Test.Common.Categories
{
public class IntegrationTestAttribute : CategoryAttribute
{
public IntegrationTestAttribute()
: base("Integration Test")
: base("IntegrationTest")
{
}

View file

@ -41,7 +41,10 @@ namespace NzbDrone.Test.Common
[TearDown]
public void LoggingDownBase()
{
ExceptionVerification.AssertNoUnexcpectedLogs();
if (TestContext.CurrentContext.Result.Status == TestStatus.Passed)
{
ExceptionVerification.AssertNoUnexcpectedLogs();
}
}
}
}

View file

@ -91,7 +91,7 @@
<Compile Include="AutoMoq\Unity\AutoMockingBuilderStrategy.cs" />
<Compile Include="AutoMoq\Unity\AutoMockingContainerExtension.cs" />
<Compile Include="ExceptionVerification.cs" />
<Compile Include="IntegrationTest.cs" />
<Compile Include="Categories\IntegrationTestAttribute.cs" />
<Compile Include="LoggingTest.cs" />
<Compile Include="MockerExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View file

@ -34,6 +34,7 @@ namespace NzbDrone.Test.Common
}
}
}
public abstract class TestBase : LoggingTest
@ -101,6 +102,20 @@ namespace NzbDrone.Test.Common
catch (Exception)
{
}
if (TestContext.CurrentContext.Result.Status == TestStatus.Failed)
{
var testName = TestContext.CurrentContext.Test.Name.ToLower();
if (EnvironmentProvider.IsLinux && testName.Contains("windows"))
{
throw new IgnoreException("windows specific test");
}
else if (testName.Contains("linux"))
{
throw new IgnoreException("linux specific test");
}
}
}
protected void WithTempAsAppPath()