File tree Expand file tree Collapse file tree 2 files changed +14
-19
lines changed
tests/ConsoleAppFramework.NativeAotTests Expand file tree Collapse file tree 2 files changed +14
-19
lines changed Original file line number Diff line number Diff line change 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
189app . 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-
Original file line number Diff line number Diff line change 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 ]
You can’t perform that action at this time.
0 commit comments