Skip to content

Commit 579cac2

Browse files
JanKrivanekJanProvaznik
authored andcommitted
Fix tests after 'WarnOnCultureOverwritten' made an opt-in
1 parent 7db0ba8 commit 579cac2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/Microsoft.NET.Build.Tests/GivenThatWeWantMSBuildToRespectCustomCulture.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public void SupportRespectAlreadyAssignedItemCulture_ByDefault_ForDotnet9(string
2929

3030
[InlineData("net7.0")]
3131
[InlineData("net6.0")]
32+
// Until MSBuild 17.13 is merged into FullFW MSBuild in sdk tests - the WarnOnCultureOverwritten
33+
// is not supported - and the build will fail copy (more details in the last test).
3234
[CoreMSBuildOnlyTheory]
3335
public void SupportRespectAlreadyAssignedItemCulture_IsNotSupported_BuildShouldWarn(string targetFramework)
3436
{
@@ -39,17 +41,17 @@ public void SupportRespectAlreadyAssignedItemCulture_IsNotSupported_BuildShouldW
3941

4042
var buildCommand = new BuildCommand(testAsset);
4143
// Custom culture is allowed, but if set explicitly and overwritten - a warning is issued.
42-
buildCommand.Execute().Should().Pass().And
44+
// However the warning is explicit opt-in.
45+
buildCommand.Execute("/p:WarnOnCultureOverwritten=true").Should().Pass().And
4346
// warning MSB3002: Explicitly set culture "test-1" for item "Resources.test-1.resx" was overwritten with inferred culture "", because 'RespectAlreadyAssignedItemCulture' property was not set.
4447
.HaveStdOutContaining("warning MSB3002:");
4548
}
4649

4750
[InlineData("net7.0")]
4851
[InlineData("net6.0")]
49-
[FullMSBuildOnlyTheory]
50-
// Is this Failing? Is full FW MSBuild already on 17.13? Then remove this test and remove `[CoreMSBuildOnlyTheory]` attribute on the test above
52+
// Is this Failing? Check if WarnOnCultureOverwritten hasn't been made a default opt-in in sdk or MSBuild.
5153
//
52-
// Until MSBuild 17.13 is merged into FullFW MSBuild in sdk tests - the test will fail, as
54+
// Without explicit opt-in via WarnOnCultureOverwritten - the test will fail, as
5355
// proper recognition of custom cultures in RAR is not supported and hence the build will fail during copy:
5456
//
5557
// Microsoft.Common.CurrentVersion.targets(4959,5): error MSB3030: Could not copy the file "obj\Debug\net7.0\test-1\MSBuildCultureResourceGeneration.resources.dll" because it was not found.

0 commit comments

Comments
 (0)