You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/FSharp.Test.Utilities/TestFramework.fs
+77-35Lines changed: 77 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -142,41 +142,72 @@ type TestConfig =
142
142
DotNetExe:string
143
143
DefaultPlatform:string}
144
144
145
+
#if NETCOREAPP
146
+
openSystem.Runtime.InteropServices
147
+
#endif
145
148
146
-
moduleWindowsPlatform =
147
-
letIs64BitOperatingSystem envVars =
148
-
// On Windows PROCESSOR_ARCHITECTURE has the value AMD64 on 64 bit Intel Machines
149
-
letvalue=
150
-
letfind s = envVars |> Map.tryFind s
151
-
[|"PROCESSOR_ARCHITECTURE"|]|> Seq.tryPick (fun s -> find s)|>function None ->""| Some x -> x
152
-
value ="AMD64"
149
+
letgetOperatingSystem()=
150
+
#if NETCOREAPP
151
+
letisPlatform p = RuntimeInformation.IsOSPlatform(p)
152
+
if isPlatform OSPlatform.Windows then"win"
153
+
elif isPlatform OSPlatform.Linux then"linux"
154
+
elif isPlatform OSPlatform.OSX then"osx"
155
+
else"unknown"
156
+
#else
157
+
"win"
158
+
#endif
153
159
154
-
typeFSLibPaths=
160
+
moduleDotnetPlatform =
161
+
letIs64BitOperatingSystem envVars =
162
+
match getOperatingSystem ()with
163
+
|"win"->
164
+
// On Windows PROCESSOR_ARCHITECTURE has the value AMD64 on 64 bit Intel Machines
165
+
letvalue=
166
+
letfind s = envVars |> Map.tryFind s
167
+
[|"PROCESSOR_ARCHITECTURE"|]|> Seq.tryPick (fun s -> find s)|>function None ->""| Some x -> x
168
+
value ="AMD64"
169
+
|_-> System.Environment.Is64BitOperatingSystem // As an alternative for netstandard1.4+: System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture
170
+
171
+
typeFSLibPaths=
155
172
{ FSCOREDLLPATH :string }
156
173
157
-
letrequireFile nm =
158
-
if Commands.fileExists __SOURCE_DIRECTORY__ nm |> Option.isSome then nm else failwith (sprintf "couldn't find %s. Running 'build test' once might solve this issue" nm)
159
-
160
-
letpackagesDir=
161
-
match Environment.GetEnvironmentVariable("NUGET_PACKAGES")with
// Linux filesystems are (in most cases) case-sensitive.
185
+
// However when nuget packages are installed to $HOME/.nuget/packages, it seems they are lowercased
186
+
letfullPath=(dir ++ path)
187
+
match Commands.fileExists __SOURCE_DIRECTORY__ fullPath with
188
+
| Some p -> p
189
+
| None ->
190
+
letfullPathLower=(dir ++ path.ToLower())
191
+
match Commands.fileExists __SOURCE_DIRECTORY__ fullPathLower with
192
+
| Some p -> p
193
+
| None -> failwith (sprintf "Couldn't find \"%s\" on the following paths: \"%s\", \"%s\". Running 'build test' once might solve this issue" path fullPath fullPathLower)
0 commit comments