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
3 changes: 1 addition & 2 deletions src/Tests/Microsoft.NET.Build.Tests/DepsFileSkipTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public void RuntimeAssemblyFromRuntimePackCanBeSkipped()
TestSkippingFile(testProject, filenameToSkip, "runtime");
}

// Core MSBuild only because CI machines don't have updated VS (with support for RuntimeIdentifierGraphPath)
[CoreMSBuildOnlyFact]
[Fact]
public void NativeAssetFromPackageCanBeSkipped()
{
var testProject = new TestProject()
Expand Down
40 changes: 19 additions & 21 deletions src/Tests/Microsoft.NET.Build.Tests/GivenFrameworkReferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public static void Main(string [] args)
}
}";

// Tests in this class are currently Core MSBuild only, as they check for PackageDownload items,
// which are currently only used in Core MSBuild
[CoreMSBuildAndWindowsOnlyFact]
[WindowsOnlyFact]
public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_multiple_FrameworkReferences()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -71,7 +69,7 @@ public void Multiple_frameworks_are_written_to_runtimeconfig_when_there_are_mult
runtimeFrameworkNames.Should().BeEquivalentTo("Microsoft.AspNetCore.App", "Microsoft.WindowsDesktop.App");
}

[CoreMSBuildOnlyTheory]
[Theory]
[InlineData("netcoreapp3.0", false)]
[InlineData("netcoreapp3.1", true)]
public void Multiple_frameworks_are_written_to_runtimeconfig_for_self_contained_apps(string tfm, bool shouldHaveIncludedFrameworks)
Expand Down Expand Up @@ -118,7 +116,7 @@ public void Multiple_frameworks_are_written_to_runtimeconfig_for_self_contained_
}
}

[CoreMSBuildOnlyFact]
[Fact]
public void ForceGenerateRuntimeConfigurationFiles_works_even_on_netFramework_tfm()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -147,7 +145,7 @@ public void ForceGenerateRuntimeConfigurationFiles_works_even_on_netFramework_tf
Assert.True(File.Exists(runtimeConfigFile), $"Expected to generate runtime config file '{runtimeConfigFile}'");
}

[CoreMSBuildAndWindowsOnlyFact]
[WindowsOnlyFact]
public void DuplicateFrameworksAreNotWrittenToRuntimeConfigWhenThereAreDifferentProfiles()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -182,7 +180,7 @@ public void DuplicateFrameworksAreNotWrittenToRuntimeConfigWhenThereAreDifferent
runtimeFrameworkNames.Should().BeEquivalentTo("Microsoft.WindowsDesktop.App");
}

[CoreMSBuildOnlyFact]
[Fact]
public void The_build_fails_when_there_is_an_unknown_FrameworkReference()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -220,7 +218,7 @@ public void The_build_fails_when_there_is_an_unknown_FrameworkReference()
;
}

[CoreMSBuildOnlyTheory]
[Theory]
[InlineData("netcoreapp2.1", false)]
[InlineData("netcoreapp3.0", true)]
public void KnownFrameworkReferencesOnlyApplyToCorrectTargetFramework(string targetFramework, bool shouldPass)
Expand Down Expand Up @@ -263,7 +261,7 @@ public void KnownFrameworkReferencesOnlyApplyToCorrectTargetFramework(string tar
}
}

[CoreMSBuildOnlyFact]
[Fact]
public void TargetingPackDownloadCanBeDisabled()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -389,7 +387,7 @@ public void RollForwardIsNotSupportedOn22(string rollForwardValue, bool valid)
}
}

[CoreMSBuildAndWindowsOnlyFact]
[WindowsOnlyFact]
public void BuildFailsIfRuntimePackIsNotAvailableForRuntimeIdentifier()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -427,7 +425,7 @@ public void BuildFailsIfRuntimePackIsNotAvailableForRuntimeIdentifier()
.HaveStdOutContaining("1 Error(s)");
}

[CoreMSBuildOnlyFact]
[Fact]
public void BuildFailsIfInvalidRuntimeIdentifierIsSpecified()
{
var testProject = new TestProject()
Expand All @@ -454,7 +452,7 @@ public void BuildFailsIfInvalidRuntimeIdentifierIsSpecified()
.HaveStdOutContaining("1 Error(s)");
}

[CoreMSBuildOnlyFact]
[Fact]
public void BuildFailsIfRuntimePackHasNotBeenRestored()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -495,7 +493,7 @@ public void BuildFailsIfRuntimePackHasNotBeenRestored()

}

[CoreMSBuildOnlyFact]
[Fact]
public void RuntimeFrameworkVersionCanBeSpecifiedOnFrameworkReference()
{
var testProject = new TestProject();
Expand Down Expand Up @@ -527,7 +525,7 @@ public void RuntimeFrameworkVersionCanBeSpecifiedOnFrameworkReference()
resolvedVersions.AppHostPack["AppHost"].Should().Be("3.0.0-runtimeframeworkversion-property");
}

[CoreMSBuildOnlyFact]
[Fact]
public void RuntimeFrameworkVersionCanBeSpecifiedViaProperty()
{
var testProject = new TestProject();
Expand All @@ -550,7 +548,7 @@ public void RuntimeFrameworkVersionCanBeSpecifiedViaProperty()
resolvedVersions.AppHostPack["AppHost"].Should().Be(runtimeFrameworkVersion);
}

[CoreMSBuildOnlyTheory]
[Theory]
[InlineData(true)]
[InlineData(false)]
public void TargetLatestPatchCanBeSpecifiedOnFrameworkReference(bool attributeValue)
Expand Down Expand Up @@ -586,7 +584,7 @@ public void TargetLatestPatchCanBeSpecifiedOnFrameworkReference(bool attributeVa
resolvedVersions.AppHostPack["AppHost"].Should().Be("3.0.0-apphostversion");
}

[CoreMSBuildOnlyTheory]
[Theory]
[InlineData(true)]
[InlineData(false)]
public void TargetLatestPatchCanBeSpecifiedViaProperty(bool propertyValue)
Expand All @@ -612,7 +610,7 @@ public void TargetLatestPatchCanBeSpecifiedViaProperty(bool propertyValue)
resolvedVersions.AppHostPack["AppHost"].Should().Be("3.0.0-apphostversion");
}

[CoreMSBuildOnlyFact]
[Fact]
public void TargetingPackVersionCanBeSpecifiedOnFrameworkReference()
{
var testProject = new TestProject();
Expand Down Expand Up @@ -646,7 +644,7 @@ public void TargetingPackVersionCanBeSpecifiedOnFrameworkReference()
// Transitive framework references require NuGet support, which isn't currently
// in the full Framework MSBuild we use in CI, so only run these tests for
// core MSBuild for now
[CoreMSBuildOnlyFact]
[Fact]
public void TransitiveFrameworkReferenceFromProjectReference()
{
var testProject = new TestProject()
Expand Down Expand Up @@ -687,7 +685,7 @@ public void TransitiveFrameworkReferenceFromProjectReference()
runtimeFrameworkNames.Should().BeEquivalentTo("Microsoft.AspNetCore.App");
}

[CoreMSBuildOnlyFact]
[Fact]
public void TransitiveFrameworkReferenceFromPackageReference()
{
var referencedPackage = new TestProject()
Expand Down Expand Up @@ -742,7 +740,7 @@ public void TransitiveFrameworkReferenceFromPackageReference()
runtimeFrameworkNames.Should().BeEquivalentTo("Microsoft.AspNetCore.App");
}

[CoreMSBuildOnlyFact]
[Fact]
public void IsTrimmableDefaultsComeFromKnownFrameworkReference()
{
var testProject = new TestProject();
Expand All @@ -759,7 +757,7 @@ public void IsTrimmableDefaultsComeFromKnownFrameworkReference()
}
}

[CoreMSBuildOnlyFact]
[Fact]
public void IsTrimmableCanBeSpecifiedOnFrameworkReference()
{
var testProject = new TestProject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ public GivenThatWeWantAllResourcesInSatellite(ITestOutputHelper log) : base(log)
{
}

// 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]
[Fact]
public void It_retrieves_strings_successfully()
{
TestSatelliteResources(Log, _testAssetsManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ private void RestoreAndBuildTestAssets()
_satelliteAssemblyPath = Path.Combine(outputDirectory.FullName, "en", "AllResourcesInSatellite.resources.dll");
}

// 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]
[Fact]
public void It_should_produce_same_satelliteAssembly_FileVersionInfo_as_main()
{
RestoreAndBuildTestAssets();
Expand All @@ -57,7 +55,7 @@ public void It_should_produce_same_satelliteAssembly_FileVersionInfo_as_main()
satelliteAssemblyFileVersioninfo.FileDescription.Should().Be(mainAssemblyFileVersioninfo.FileDescription);
}

[CoreMSBuildOnlyFact]
[Fact]
public void It_should_produce_same_satelliteAssembly_AssemblyVersions_as_main()
{
RestoreAndBuildTestAssets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ public void It_does_not_copy_local_package_dependencies_when_requested_not_to()
}));
}

// Core MSBuild only because CI machines don't have updated VS (with support for RuntimeIdentifierGraphPath)
[CoreMSBuildOnlyFact]
[Fact]
public void It_copies_local_specific_runtime_package_dependencies_on_build()
{
const string ProjectName = "TestProjWithPackageDependencies";
Expand Down Expand Up @@ -325,8 +324,7 @@ public void It_does_not_copy_local_runtime_dependencies_for_netframework_project
});
}

// Core MSBuild only because CI machines don't have updated VS (with support for RuntimeIdentifierGraphPath)
[CoreMSBuildOnlyFact]
[Fact]
public void It_copies_local_all_assets_on_self_contained_build()
{
const string ProjectName = "TestProjWithPackageDependencies";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ TestProject GetTestProject(string name, string target, bool isSdkProject)
return ret;
}

[CoreMSBuildOnlyTheory]
[RequiresMSBuildVersionTheory("16.7.1")]
[InlineData(true, true)]
[InlineData(false, true)]
[InlineData(false, false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ public void Default_items_have_the_correct_relative_paths()
});
}

// 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]
[Fact]
public void Compile_items_can_be_explicitly_specified_while_default_EmbeddedResource_items_are_used()
{
Action<XDocument> projectChanges = project =>
Expand Down
3 changes: 1 addition & 2 deletions src/Tests/Microsoft.NET.Build.Tests/Net50Targeting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public Net50Targeting(ITestOutputHelper log) : base(log)
{
}

// Core MSBuild only until VS build we use has NuGet changes for net5.0
[CoreMSBuildOnlyFact]
[Fact]
public void Net50TargetFrameworkParsesAsNetCoreAppTargetFrameworkIdentifier()
{
var testProject = new TestProject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static void Main()
publishDirectory.Should().HaveFile($"Hello.World{Constants.ExeSuffix}");
}

[CoreMSBuildOnlyTheory]
[Theory]
[InlineData("win-arm")]
[InlineData("win8-arm")]
[InlineData("win81-arm")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ public void It_errors_when_targetting_netcoreapp_2_x()
.HaveStdOutContaining(Strings.PublishSingleFileRequiresVersion30);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_generates_a_single_file_for_framework_dependent_apps()
{
var publishCommand = GetPublishCommand();
Expand All @@ -181,8 +180,7 @@ public void It_generates_a_single_file_for_framework_dependent_apps()
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_generates_a_single_file_for_self_contained_apps()
{
var publishCommand = GetPublishCommand();
Expand All @@ -197,8 +195,7 @@ public void It_generates_a_single_file_for_self_contained_apps()
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_generates_a_single_file_including_pdbs()
{
var publishCommand = GetPublishCommand();
Expand All @@ -213,8 +210,7 @@ public void It_generates_a_single_file_including_pdbs()
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildAndWindowsOnlyFact]
[WindowsOnlyFact]
public void It_excludes_ni_pdbs_from_single_file()
{
var publishCommand = GetPublishCommand();
Expand All @@ -230,8 +226,7 @@ public void It_excludes_ni_pdbs_from_single_file()
.HaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildAndWindowsOnlyFact]
[WindowsOnlyFact]
public void It_can_include_ni_pdbs_in_single_file()
{
var publishCommand = GetPublishCommand();
Expand All @@ -246,8 +241,7 @@ public void It_can_include_ni_pdbs_in_single_file()
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyTheory]
[Theory]
[InlineData(ExcludeNewest, NewestContent)]
[InlineData(ExcludeAlways, AlwaysContent)]
public void It_generates_a_single_file_excluding_content(string exclusion, string content)
Expand All @@ -264,8 +258,7 @@ public void It_generates_a_single_file_excluding_content(string exclusion, strin
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_generates_a_single_file_for_R2R_compiled_Apps()
{
var publishCommand = GetPublishCommand();
Expand All @@ -280,8 +273,7 @@ public void It_generates_a_single_file_for_R2R_compiled_Apps()
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_does_not_rewrite_the_single_file_unnecessarily()
{
var publishCommand = GetPublishCommand();
Expand All @@ -304,8 +296,7 @@ public void It_does_not_rewrite_the_single_file_unnecessarily()
fileWriteTimeAfterSecondRun.Should().Be(fileWriteTimeAfterFirstRun);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_rewrites_the_apphost_for_single_file_publish()
{
var publishCommand = GetPublishCommand();
Expand All @@ -329,8 +320,7 @@ public void It_rewrites_the_apphost_for_single_file_publish()
singleFileSize.Should().BeGreaterThan(appHostSize);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_rewrites_the_apphost_for_non_single_file_publish()
{
var publishCommand = GetPublishCommand();
Expand All @@ -354,8 +344,7 @@ public void It_rewrites_the_apphost_for_non_single_file_publish()
appHostSize.Should().BeLessThan(singleFileSize);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyFact]
[Fact]
public void It_leaves_host_components_unbundled_when_necessary()
{
// In.net 5, Single-file bundles are processed in the framework.
Expand Down Expand Up @@ -392,8 +381,7 @@ public void It_leaves_host_components_unbundled_when_necessary()
.OnlyHaveFiles(expectedFiles);
}

// Core MSBuild only due to https://github.com/dotnet/sdk/issues/4244
[CoreMSBuildOnlyTheory]
[Theory]
[InlineData("netcoreapp3.0", false)]
[InlineData("netcoreapp3.0", true)]
[InlineData("netcoreapp3.1", false)]
Expand Down
Loading