@@ -53,23 +53,23 @@ public void TryingToResetNativeLibraryPathAfterLoadedThrows()
5353 Assert . Throws < LibGit2SharpException > ( ( ) => { GlobalSettings . NativeLibraryPath = "C:/Foo" ; } ) ;
5454 }
5555
56- [ ConditionalFact ( typeof ( NetFramework ) ) ]
57- public void LoadFromSpecifiedPath ( )
56+ [ SkippableTheory ]
57+ [ InlineData ( new object [ ] { "x86" } ) ]
58+ [ InlineData ( new object [ ] { "x64" } ) ]
59+ public void LoadFromSpecifiedPath ( string platform )
5860 {
59- #if NET461
60- var nativeDllFileName = NativeDllName . Name + ".dll" ;
61+ Skip . IfNot ( Platform . IsRunningOnNetFramework ( ) , ".NET Framework only test." ) ;
6162
62- var testAppExe = typeof ( TestApp ) . Assembly . Location ;
63+ var nativeDllFileName = NativeDllName . Name + ".dll" ;
64+ var testDir = Path . GetDirectoryName ( typeof ( GlobalSettingsFixture ) . Assembly . Location ) ;
65+ var testAppExe = Path . Combine ( testDir , $ "LibGit2Sharp.TestApp.{ platform } .exe") ;
6366 var tempDir = Path . Combine ( Path . GetTempPath ( ) , Guid . NewGuid ( ) . ToString ( ) ) ;
6467 var platformDir = Path . Combine ( tempDir , "plat" ) ;
6568
6669 try
6770 {
68- Directory . CreateDirectory ( Path . Combine ( platformDir , "x86" ) ) ;
69- Directory . CreateDirectory ( Path . Combine ( platformDir , "x64" ) ) ;
70-
71- File . Copy ( Path . Combine ( GlobalSettings . NativeLibraryPath , "x86" , nativeDllFileName ) , Path . Combine ( platformDir , "x86" , nativeDllFileName ) ) ;
72- File . Copy ( Path . Combine ( GlobalSettings . NativeLibraryPath , "x64" , nativeDllFileName ) , Path . Combine ( platformDir , "x64" , nativeDllFileName ) ) ;
71+ Directory . CreateDirectory ( Path . Combine ( platformDir , platform ) ) ;
72+ File . Copy ( Path . Combine ( GlobalSettings . NativeLibraryPath , platform , nativeDllFileName ) , Path . Combine ( platformDir , platform , nativeDllFileName ) ) ;
7373
7474 var ( output , exitCode ) = ProcessHelper . RunProcess ( testAppExe , arguments : $@ "{ NativeDllName . Name } ""{ platformDir } """, workingDirectory: tempDir);
7575
@@ -80,7 +80,6 @@ public void LoadFromSpecifiedPath()
8080 {
8181 DirectoryHelper . DeleteDirectory ( tempDir ) ;
8282 }
83- #endif
8483 }
8584 }
8685}
0 commit comments