don't compile desktop framework targets on non-windows
This commit is contained in:
parent
ceb31d8f30
commit
5ad60df96a
1 changed files with 11 additions and 5 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||||
|
@ -130,12 +131,17 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("net20", false)]
|
[InlineData("net20", false, true)]
|
||||||
[InlineData("net40", true)]
|
[InlineData("net40", true, true)]
|
||||||
[InlineData("net461", true)]
|
[InlineData("net461", true, true)]
|
||||||
[InlineData("dnxcore50", true)]
|
[InlineData("dnxcore50", true, false)]
|
||||||
public void MultipleFrameworks_ShouldHaveValidTargetFrameworkAttribute(string frameworkName, bool shouldHaveTargetFrameworkAttribute)
|
public void MultipleFrameworks_ShouldHaveValidTargetFrameworkAttribute(string frameworkName, bool shouldHaveTargetFrameworkAttribute, bool windowsOnly)
|
||||||
{
|
{
|
||||||
|
if (windowsOnly && !RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
|
{
|
||||||
|
return; // don't run test for desktop framework on non-windows
|
||||||
|
}
|
||||||
|
|
||||||
var framework = NuGetFramework.Parse(frameworkName);
|
var framework = NuGetFramework.Parse(frameworkName);
|
||||||
|
|
||||||
var testInstance = TestAssetsManager.CreateTestInstance("TestLibraryWithMultipleFrameworks")
|
var testInstance = TestAssetsManager.CreateTestInstance("TestLibraryWithMultipleFrameworks")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue