Skip to content

Commit

Permalink
Resolving: dotnet#1327
Browse files Browse the repository at this point in the history
  • Loading branch information
John Beisner committed Oct 17, 2017
1 parent 07f0d02 commit ec1e5f4
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public GivenThatWeWantToBuildACrossTargetedLibrary(ITestOutputHelper log) : base
{
}

// https://github.com/dotnet/sdk/issues/1327
[CoreMSBuildOnlyFact]
[Fact]
public void It_builds_nondesktop_library_successfully_on_all_platforms()
{
var testAsset = _testAssetsManager
Expand Down Expand Up @@ -51,14 +50,9 @@ public void It_builds_nondesktop_library_successfully_on_all_platforms()
});
}

[Fact]
[WindowsOnlyFact]
public void It_builds_desktop_library_successfully_on_windows()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("CrossTargeting")
.WithSource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@ public GivenThatWeWantToBuildADesktopExe(ITestOutputHelper log) : base(log)
{
}

[Fact]
[WindowsOnlyFact]
public void It_builds_a_simple_desktop_app()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var targetFramework = "net45";
var testAsset = _testAssetsManager
.CopyTestAsset("HelloWorld")
Expand All @@ -62,7 +57,7 @@ public void It_builds_a_simple_desktop_app()
});
}

[Theory]
[WindowsOnlyTheory]

// If we don't set platformTarget and don't use native dependency, we get working AnyCPU app.
[InlineData("defaults", null, false, "Native code was not used (MSIL)")]
Expand Down Expand Up @@ -94,11 +89,6 @@ public void It_handles_native_depdencies_and_platform_target(
bool useNativeCode,
string expectedProgramOutput)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

foreach (bool multiTarget in new[] { false, true })
{
var testAsset = _testAssetsManager
Expand Down Expand Up @@ -141,7 +131,7 @@ public void It_handles_native_depdencies_and_platform_target(
}
}

[Theory]
[WindowsOnlyTheory]

// implict rid with option to append rid to output path off -> do not append
[InlineData("implicitOff", "", false, false)]
Expand All @@ -156,11 +146,6 @@ public void It_handles_native_depdencies_and_platform_target(
[InlineData("explicitOn", "win7-x64", true, true)]
public void It_appends_rid_to_outdir_correctly(string identifier, string rid, bool useAppendOption, bool shouldAppend)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

foreach (bool multiTarget in new[] { false, true })
{
var testAsset = _testAssetsManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ public GivenThatWeWantToBuildADesktopLibrary(ITestOutputHelper log) : base(log)
{
}

[Fact]
[WindowsOnlyFact]
public void It_can_use_HttpClient_and_exchange_the_type_with_a_NETStandard_library()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var netStandardLibrary = new TestProject()
{
Name = "NETStandardLibrary",
Expand Down Expand Up @@ -202,14 +197,9 @@ public void Method1()
.Pass();
}

[Fact]
[WindowsOnlyFact]
public void It_can_preserve_compilation_context_and_reference_netstandard_library()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("DesktopReferencingNetStandardLibrary")
.WithSource()
Expand All @@ -227,14 +217,9 @@ public void It_can_preserve_compilation_context_and_reference_netstandard_librar
}
}

[Fact]
[WindowsOnlyFact]
public void It_resolves_assembly_conflicts_with_a_NETFramework_library()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

TestProject project = new TestProject()
{
Name = "NETFrameworkLibrary",
Expand Down
12 changes: 3 additions & 9 deletions test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void It_builds_the_library_twice_in_a_row()
.Pass();
}

[Fact]
[CoreMSBuildOnlyFact]
public void All_props_and_targets_add_themselves_to_MSBuildAllTargets()
{
// Workaround MSBuild bug causing preprocessing to fail if there is a "--" in a resolved Sdk path: https://github.com/Microsoft/msbuild/pull/1428
Expand All @@ -85,12 +85,6 @@ public void All_props_and_targets_add_themselves_to_MSBuildAllTargets()
return;
}

// Disable this test when using full Framework MSBuild, as the paths to the props and targets are different
if (UsingFullFrameworkMSBuild)
{
return;
}

List<string> expectedAllProjects = new List<string>();
string baseIntermediateDirectory = null;

Expand Down Expand Up @@ -163,7 +157,7 @@ public void All_props_and_targets_add_themselves_to_MSBuildAllTargets()
//builtinProjectsFromProperty.Should().BeEquivalentTo(expectedBuiltinProjects);
}



internal static List<string> GetValuesFromTestLibrary(
ITestOutputHelper log,
Expand Down Expand Up @@ -739,4 +733,4 @@ public void It_can_target_uwp_using_sdk_extras()
.Pass();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,9 @@ public void It_generates_satellite_assemblies()
commandResult.Should().HaveStdOutContaining(val);
}
}
[Fact]
[WindowsOnlyFact]
public void The_clean_target_removes_all_files_from_the_output_folder()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("AppWithLibrary")
.WithSource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,9 @@ void VerifyAppBuilds(TestAsset testAsset)
.HaveStdOutContaining("This string came from AuxLibrary!");
}

[Fact]
[WindowsOnlyFact]
public void The_clean_target_removes_all_files_from_the_output_folder()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("AppWithTransitiveProjectRefs")
.WithSource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ public GivenThatWeWantToBuildAppsWithFrameworkRefs(ITestOutputHelper log) : base
{
}

[Fact]
[WindowsOnlyFact]
public void It_builds_the_projects_successfully()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("AppsWithFrameworkReferences")
.WithSource();
Expand All @@ -41,14 +36,9 @@ public void It_builds_the_projects_successfully()
VerifyProjectsBuild(testAsset);
}

[Fact]
[WindowsOnlyFact]
public void It_builds_with_disable_implicit_frameworkRefs()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("AppsWithFrameworkReferences")
.WithSource();
Expand Down Expand Up @@ -100,14 +90,9 @@ private void VerifyBuild(TestAsset testAsset, string project, string targetFrame
outputDirectory.Should().HaveFiles(expectedFiles);
}

[Fact]
[WindowsOnlyFact]
public void The_clean_target_removes_all_files_from_the_output_folder()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("AppsWithFrameworkReferences", "CleanTargetRemovesAll")
.WithSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ public void Nuget_reference_compat(string referencerTarget, string testDescripti
}
}

// https://github.com/dotnet/sdk/issues/1327
[CoreMSBuildAndWindowsOnlyTheory]
[WindowsOnlyTheory]
[InlineData("netstandard2.0")]
[InlineData("netcoreapp2.0")]
public void Net461_is_implicit_for_Netstandard_and_Netcore_20(string targetFramework)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,9 @@ public void Packing_a_netcoreapp_1_1_app_includes_the_implicit_dependency()
.Should().StartWith("1.1.");
}

[Fact]
[WindowsOnlyFact]
public void Packing_an_app_exclude_dependencys_framework_assemblies_dependency()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
TestProject testProject = new TestProject()
{
Name = "PackNet461App",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public GivenThatWeWantToPackACrossTargetedLibrary(ITestOutputHelper log) : base(
{
}

// https://github.com/dotnet/sdk/issues/1327
[CoreMSBuildOnlyFact]
[Fact]
public void It_packs_nondesktop_library_successfully_on_all_platforms()
{
var testAsset = _testAssetsManager
Expand Down Expand Up @@ -50,4 +49,4 @@ public void It_packs_nondesktop_library_successfully_on_all_platforms()
});
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,9 @@ public void It_publishes_projects_with_simple_dependencies()
.HaveStdOutContaining(expectedOutput);
}

[Fact]
[WindowsOnlyFact]
public void It_publishes_the_app_config_if_necessary()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("DesktopNeedsBindingRedirects")
.WithSource()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public GivenThatWeWantToRestoreProjectsUsingNuGetConfigProperties(ITestOutputHel
{
}

// https://github.com/dotnet/sdk/issues/1327
[CoreMSBuildOnlyTheory]
[Theory]
[InlineData("netstandard1.3", "1.3", false)]
[InlineData("netcoreapp1.0", "1.0", true)]
[InlineData("netcoreapp1.1", "1.1", true)]
Expand Down Expand Up @@ -53,8 +52,7 @@ public void I_can_restore_a_project_with_implicit_msbuild_nuget_config(
"projectinfallbackfolder.1.0.0.nupkg")).Should().Be(fileExists);
}

// https://github.com/dotnet/sdk/issues/1327
[CoreMSBuildOnlyTheory]
[Theory]
[InlineData("netstandard1.3", "1.3")]
[InlineData("netcoreapp1.0", "1.0")]
[InlineData("netcoreapp1.1", "1.1")]
Expand Down Expand Up @@ -157,4 +155,4 @@ private void ExtractNupkg(string nugetCache, string nupkg)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public GivenThatWeWantToRestoreProjectsWithPackageDowngrades(ITestOutputHelper l
{
}

// https://github.com/dotnet/sdk/issues/1327
[CoreMSBuildOnlyFact]
[Fact]
public void DowngradeWarningsAreErrorsByDefault()
{
const string testProjectName = "ProjectWithDowngradeWarning";
Expand All @@ -48,7 +47,7 @@ public void DowngradeWarningsAreErrorsByDefault()
.And.HaveStdOutContaining("NU1605");
}

[CoreMSBuildOnlyFact]
[Fact]
public void ItIsPossibleToTurnOffDowngradeWarningsAsErrors()
{
const string testProjectName = "ProjectWithDowngradeWarning";
Expand All @@ -73,4 +72,4 @@ public void ItIsPossibleToTurnOffDowngradeWarningsAsErrors()
.Should().Pass();;
}
}
}
}

0 comments on commit ec1e5f4

Please sign in to comment.