@@ -52,7 +52,7 @@ class Test
5252
5353 [ DllImport ( UnicodeFileName , EntryPoint = "GetZero" ) ]
5454 private static extern int GetZero_Unicode ( ) ;
55-
55+
5656 [ DllImport ( PathEnvFileName , EntryPoint = "GetZero" ) ]
5757 private static extern int GetZero_PathEnv ( ) ;
5858
@@ -83,7 +83,7 @@ static void TestNativeLibraryProbingOnRelativePath()
8383 bool isWindows = OperatingSystem . IsWindows ( ) ;
8484
8585 if ( ! isWindows ) // We need to ensure that the subdirectory exists for off-Windows.
86- {
86+ {
8787 var currentDirectory = Directory . GetCurrentDirectory ( ) ;
8888 var info = new DirectoryInfo ( currentDirectory ) ;
8989 info . CreateSubdirectory ( RelativeSubdirectoryName ) ;
@@ -97,12 +97,12 @@ static void TestNativeLibraryProbingOnRelativePath()
9797 {
9898 GetZero_Relative1Unix ( ) ;
9999 }
100-
100+
101101 if ( OperatingSystem . IsWindows ( ) )
102102 {
103103 GetZero_Relative2 ( ) ;
104104 }
105-
105+
106106 if ( isWindows )
107107 {
108108 GetZero_Relative3Windows ( ) ;
@@ -150,7 +150,7 @@ private static void SetupUnicodeTest()
150150 localFile . Extension == ".dll"
151151 || localFile . Extension == ".so"
152152 || localFile . Extension == ".dylib" ) ;
153-
153+
154154 var unicodeFileLocation = file . FullName . Replace ( "DllImportPath_Local" , UnicodeFileName ) ;
155155
156156 file . CopyTo ( unicodeFileLocation , true ) ;
@@ -178,7 +178,11 @@ public static int Main(string[] args)
178178 {
179179 TestNativeLibraryProbingUnicode ( ) ;
180180 }
181- TestNativeLibraryProbingOnPathEnv ( ) ;
181+ // Setting LD_LIBRARY_PATH/DYLD_LIBRARY_PATH may not be allowed on Mac
182+ if ( ! OperatingSystem . IsMacOS ( ) )
183+ {
184+ TestNativeLibraryProbingOnPathEnv ( ) ;
185+ }
182186 if ( OperatingSystem . IsWindows ( ) )
183187 {
184188 TestNativeExeProbing ( ) ;
0 commit comments