Skip to content

Commit

Permalink
[iOS][tests] NativeAOT: Do not treat warnings as errors in integratio…
Browse files Browse the repository at this point in the history
…n tests (#20471)

* Fix RunOniOS test

* Do not treat NativeAOT build warnings as errors - introduced with dotnet/runtime#96567

---------

Co-authored-by: Simon Rozsival <simon@rozsival.com>
  • Loading branch information
ivanpovazan and simonrozsival committed Feb 12, 2024
1 parent aeba2dd commit b3e50af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void RunOniOS(string id, string config, string framework, string runtimeI
buildProps.Add("PublishAotUsingRuntimePack=true"); // TODO: This parameter will become obsolete https://github.com/dotnet/runtime/issues/87060
buildProps.Add("_IsPublishing=true"); // using dotnet build with -p:_IsPublishing=true enables targeting simulators
buildProps.Add($"RuntimeIdentifier={runtimeIdentifier}");
buildProps.Add("IlcTreatWarningsAsErrors=false"); // TODO: Remove this once all warnings are fixed https://github.com/dotnet/maui/issues/19397
}

Assert.IsTrue(DotnetInternal.Build(projectFile, config, framework: $"{framework}-ios", properties: buildProps),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public void PublishNativeAOT(string id, string framework, string runtimeIdentifi
var extendedBuildProps = BuildProps;
extendedBuildProps.Add("PublishAot=true");
extendedBuildProps.Add("PublishAotUsingRuntimePack=true"); // TODO: This parameter will become obsolete https://github.com/dotnet/runtime/issues/87060
extendedBuildProps.Add("IlcTreatWarningsAsErrors=false");

Assert.IsTrue(DotnetInternal.Publish(projectFile, "Release", framework: framework, properties: extendedBuildProps, runtimeIdentifier: runtimeIdentifier),
$"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors.");
Expand All @@ -216,6 +217,7 @@ public void PublishNativeAOTCheckWarnings(string id, string framework, string ru
var extendedBuildProps = BuildProps;
extendedBuildProps.Add("PublishAot=true");
extendedBuildProps.Add("PublishAotUsingRuntimePack=true"); // TODO: This parameter will become obsolete https://github.com/dotnet/runtime/issues/87060
extendedBuildProps.Add("IlcTreatWarningsAsErrors=false");
extendedBuildProps.Add("TrimmerSingleWarn=false");

string binLogFilePath = $"publish-{DateTime.UtcNow.ToFileTimeUtc()}.binlog";
Expand Down

0 comments on commit b3e50af

Please sign in to comment.