Skip to content

Commit 471a40b

Browse files
committed
nativeaot test comment
1 parent 1fc5a9a commit 471a40b

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed
Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
1-
using Autofac;
2-
using Autofac.Extensions.DependencyInjection;
3-
using ConsoleAppFramework;
4-
using Microsoft.Extensions.DependencyInjection;
1+
using ConsoleAppFramework;
52

3+
args = ["write", "--help"];
64

7-
var app = ConsoleApp.Create()
8-
.ConfigureContainer(new AutofacServiceProviderFactory(), builder =>
9-
{
10-
builder.RegisterType<MyService>();
11-
});
5+
var app = ConsoleApp.Create();
126

13-
app.Add("", ([FromServices] MyService service) => { service.Hello(); });
14-
15-
16-
// Environment
7+
app.Add("write", (Target target) => { });
178

189
app.Run(args);
1910

20-
public class MyService
11+
public enum Target
2112
{
22-
public void Hello() => throw new Exception();
13+
File,
14+
Network
2315
}
24-
25-

tests/ConsoleAppFramework.NativeAotTests/NativeAotTest.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
using ConsoleAppFramework;
2-
using System.ComponentModel.DataAnnotations;
1+
using System.ComponentModel.DataAnnotations;
2+
3+
// This test verifies the behavior of NativeAOT.
4+
// Instead of running dotnet test, you must execute the exe generated by dotnet publish.
5+
// In the GitHub Actions workflow:
6+
// - run: dotnet publish -r linux-x64 tests/ConsoleAppFramework.NativeAotTests/ConsoleAppFramework.NativeAotTests.csproj
7+
// - run: tests/ConsoleAppFramework.NativeAotTests/bin/Release/net10.0/linux-x64/publish/ConsoleAppFramework.NativeAotTests
38

49
// not parallel to check exit-code
510
[assembly: NotInParallel]

0 commit comments

Comments
 (0)