Skip to content

Commit 1bcf1bd

Browse files
Copilotagocke
andcommitted
Simplify test: change to Fact and remove unnecessary settings
- Changed from RequiresMSBuildVersionTheory with InlineData to Fact - Removed StripSymbols setting (default in .NET 10) - Removed useRuntimePackLayout logic (hardcoded to true) - Set targetFramework directly to CurrentTargetFramework Co-authored-by: agocke <[email protected]>
1 parent 900e4f6 commit 1bcf1bd

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,15 @@ public void NativeAot_hw_runs_with_no_warnings_when_PublishAot_is_enabled(string
7777
.And.HaveStdOutContaining("Hello World");
7878
}
7979

80-
[RequiresMSBuildVersionTheory("17.12.0", Skip = "https://github.com/dotnet/sdk/issues/46006")]
81-
[InlineData(ToolsetInfo.CurrentTargetFramework)]
82-
public void NativeAot_app_publishes_with_space_in_path(string targetFramework)
80+
[Fact(Skip = "https://github.com/dotnet/sdk/issues/46006")]
81+
public void NativeAot_app_publishes_with_space_in_path()
8382
{
83+
var targetFramework = ToolsetInfo.CurrentTargetFramework;
8484
var projectName = "HelloWorldNativeAotApp";
8585

8686
var testProject = CreateHelloWorldTestProject(targetFramework, projectName, true);
8787
testProject.RecordProperties("NETCoreSdkPortableRuntimeIdentifier");
8888
testProject.AdditionalProperties["PublishAot"] = "true";
89-
// Linux symbol files are embedded and require additional steps to be stripped to a separate file
90-
// assumes /bin (or /usr/bin) are in the PATH
91-
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
92-
{
93-
testProject.AdditionalProperties["StripSymbols"] = "true";
94-
}
9589
// Use an identifier with a space to create a path with a space
9690
var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: "path with spaces");
9791

@@ -117,10 +111,8 @@ public void NativeAot_app_publishes_with_space_in_path(string targetFramework)
117111
DoSymbolsExist(publishDirectory, testProject.Name).Should().BeTrue($"{publishDirectory} should contain {testProject.Name} symbol");
118112
IsNativeImage(publishedExe).Should().BeTrue();
119113

120-
bool useRuntimePackLayout = targetFramework is not ("net7.0" or "net8.0" or "net9.0");
121-
122114
GetKnownILCompilerPackVersion(testAsset, targetFramework, out string expectedVersion);
123-
CheckIlcVersions(testAsset, targetFramework, rid, expectedVersion, useRuntimePackLayout);
115+
CheckIlcVersions(testAsset, targetFramework, rid, expectedVersion, useRuntimePackLayout: true);
124116

125117
var command = new RunExeCommand(Log, publishedExe)
126118
.Execute().Should().Pass()

0 commit comments

Comments
 (0)