Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- Toolset Dependencies -->
<PropertyGroup>
<DotNetCliVersion>15.5.0-preview-007044</DotNetCliVersion>
<RoslynToolsRepoToolsetVersion>1.0.0-beta-62518-01</RoslynToolsRepoToolsetVersion>
<RoslynToolsRepoToolsetVersion>1.0.0-beta-62519-01</RoslynToolsRepoToolsetVersion>
<VSWhereVersion>2.2.7</VSWhereVersion>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@ public GivenThatWeWantAllResourcesInSatellite(ITestOutputHelper log) : base(log)
{
}

[Fact]
// Disable this test on full framework, as generating strong named satellite assemblies with AL.exe requires Admin permissions
// See https://github.com/dotnet/sdk/issues/732
[CoreMSBuildOnlyFact]
public void It_retrieves_strings_successfully()
{
if (UsingFullFrameworkMSBuild)
{
// Disable this test on full framework, as generating strong named satellite assemblies with AL.exe requires Admin permissions
// See https://github.com/dotnet/sdk/issues/732
return;
}

TestSatelliteResources(Log, _testAssetsManager);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,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 @@ -27,14 +27,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 @@ -61,29 +56,21 @@ 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)")]

// If we don't set platformTarget and do use native dependency, we get working x86 app.
[InlineData("defaultsNative", null, true, "Native code was used (X86)")]

// If we set x86 and don't use native dependency, we get working x86 app.
[InlineData("x86", "x86", false, "Native code was not used (X86)")]

// If we set x86 and do use native dependency, we get working x86 app.
[InlineData("x86Native", "x86", true, "Native code was used (X86)")]

// If we set x64 and don't use native dependency, we get working x64 app.
[InlineData("x64", "x64", false, "Native code was not used (Amd64)")]

// If we set x64 and do use native dependency, we get working x64 app.
[InlineData("x64Native", "x64", true, "Native code was used (Amd64)")]

// If we set AnyCPU and don't use native dependency, we get working AnyCPU app.
[InlineData("AnyCPU", "AnyCPU", false, "Native code was not used (MSIL)")]

// If we set AnyCPU and do use native dependency, we get any CPU app that can't find its native dependency.
// Tests current behavior, but ideally we'd also raise a build diagnostic in this case: https://github.com/dotnet/sdk/issues/843
[InlineData("AnyCPUNative", "AnyCPU", true, "Native code failed (MSIL)")]
Expand All @@ -93,11 +80,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 @@ -140,26 +122,17 @@ 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)]

// implicit rid with option to append rid to output path on -> do not append (never append implicit rid irrespective of option)
[InlineData("implicitOn", "", true, false)]

// explicit rid with option to append rid to output path off -> do not append
[InlineData("explicitOff", "win7-x86", false, false)]

// explicit rid with option to append rid to output path on -> append
[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 Expand Up @@ -231,8 +204,7 @@ public void It_appends_rid_to_outdir_correctly(string identifier, string rid, bo
}
}


[Theory]
[WindowsOnlyTheory]
[InlineData("win7-x86", "x86")]
[InlineData("win8-x86-aot", "x86")]
[InlineData("win7-x64", "x64")]
Expand All @@ -248,11 +220,6 @@ public void It_appends_rid_to_outdir_correctly(string identifier, string rid, bo
[InlineData("arm-something", "AnyCPU")]
public void It_builds_with_inferred_platform_target(string runtimeIdentifier, string expectedPlatformTarget)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testAsset = _testAssetsManager
.CopyTestAsset("DesktopMinusRid", identifier: Path.DirectorySeparatorChar + runtimeIdentifier)
.WithSource()
Expand All @@ -272,14 +239,9 @@ public void It_builds_with_inferred_platform_target(string runtimeIdentifier, st
.BeEquivalentTo(expectedPlatformTarget);
}

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

var testAsset = _testAssetsManager
.CopyTestAsset("DesktopMinusRid")
.WithSource()
Expand All @@ -299,14 +261,9 @@ public void It_respects_explicit_platform_target()
.BeEquivalentTo("x64");
}

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

var testProject = new TestProject()
{
Name = "DefaultReferences",
Expand Down Expand Up @@ -346,14 +303,9 @@ public static void Main(string [] args)

}

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

var testProject = new TestProject()
{
Name = "MissingReferenceAssemblies",
Expand Down Expand Up @@ -383,14 +335,9 @@ public void It_reports_a_single_failure_if_reference_assemblies_are_not_found()
result.StdOut.Should().Contain("1 Error(s)");
}

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

var testProject = new TestProject()
{
Name = "DuplicateFrameworkReferences",
Expand Down Expand Up @@ -421,14 +368,9 @@ public void It_does_not_report_conflicts_if_the_same_framework_assembly_is_refer
.NotHaveStdOutMatching("Encountered conflict", System.Text.RegularExpressions.RegexOptions.CultureInvariant | System.Text.RegularExpressions.RegexOptions.IgnoreCase);
}

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

var testProject = new TestProject()
{
Name = "DesktopConflictsNuGet",
Expand Down Expand Up @@ -536,14 +478,9 @@ public void It_does_not_report_conflicts_with_runtime_specific_items()
buildResult.Should().NotHaveStdOutMatching("Encountered conflict", System.Text.RegularExpressions.RegexOptions.CultureInvariant | System.Text.RegularExpressions.RegexOptions.IgnoreCase);
}

[Fact]
[WindowsOnlyFact]
public void It_generates_binding_redirects_if_needed()
{
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 @@ -23,14 +23,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 @@ -200,14 +195,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 @@ -225,14 +215,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
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,9 @@ public void It_builds_the_library_twice_in_a_row()
.Pass();
}

[Fact(Skip = "https://github.com/dotnet/sdk/issues/1810")]
[CoreMSBuildOnlyFact(Skip = "https://github.com/dotnet/sdk/issues/1810")]
public void All_props_and_targets_add_themselves_to_MSBuildAllTargets()
{
// 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
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,10 @@ 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 @@ -77,14 +77,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 @@ -22,14 +22,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 @@ -40,14 +35,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 @@ -99,14 +89,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
Loading