File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Runtime . InteropServices ;
3+ using System . Runtime . CompilerServices ;
34
45namespace Test {
56 public static class Program {
7+ [ ModuleInitializer ]
8+ internal static void Init ( ) {
9+ Console . WriteLine ( "C# Module Loaded" ) ;
10+ Console . WriteLine ( $ "Running under .NET { Environment . Version } ") ;
11+ }
12+
613 public static int Hello ( IntPtr arg , int argLength ) {
714 Console . WriteLine ( "Hello from C#!" ) ;
815 return 42 ;
Original file line number Diff line number Diff line change @@ -91,8 +91,32 @@ pub fn library_dll_path() -> PdCString {
9191 . unwrap ( )
9292}
9393
94+ pub fn display_framework_id ( id : & str ) -> String {
95+ let s = id. trim_start_matches ( '.' ) ;
96+
97+ if let Some ( rest) = s. strip_prefix ( "netcoreapp" ) {
98+ // .netcoreappX.Y → .NET Core X.Y
99+ let version = rest. trim_start_matches ( '.' ) ;
100+ return format ! ( ".NET Core {}" , version) ;
101+ }
102+
103+ if let Some ( rest) = s. strip_prefix ( "net" ) {
104+ // .netX.Y → .NET X.Y
105+ let version = rest. trim_start_matches ( '.' ) ;
106+ return format ! ( ".NET {}" , version) ;
107+ }
108+
109+ // Fallback
110+ id. to_string ( )
111+ }
112+
94113pub fn setup ( ) {
114+ println ! ( "Running Test Setup" ) ;
115+ println ! ( "Using {}" , display_framework_id( & test_netcore_version( ) ) ) ;
116+
117+ println ! ( "Building Test Project" ) ;
95118 build_test_project ( ) ;
119+ println ! ( "Building Library Project" ) ;
96120 build_library_project ( ) ;
97121}
98122
You can’t perform that action at this time.
0 commit comments