-
Notifications
You must be signed in to change notification settings - Fork 19
/
test.fsx
35 lines (28 loc) · 850 Bytes
/
test.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#r "nuget: Fake.DotNet.Cli"
#r "nuget: Fake.IO.FileSystem"
open Fake.DotNet
open Fake.IO.Globbing.Operators
open System
let runtime =
if OperatingSystem.IsMacOS() then
"osx-x64"
elif OperatingSystem.IsLinux() then
"linux-x64"
else
"win-x64"
let runTest (projectPath: string) =
let rid =
if projectPath.EndsWith("Audio.Tests.fsproj") ||
projectPath.EndsWith("DLCProject.Tests.fsproj")
then
$" --runtime {runtime}"
else
String.Empty
printfn "INFO: Executing tests for project %s" (IO.Path.GetFileName(projectPath))
let result = DotNet.exec id "test" $"\"{projectPath}\" -c Release{rid}"
if result.ExitCode <> 0 then
failwith "Test failed."
!! "tests/**/*.fsproj"
|> Seq.iter runTest
!! "tests/**/*.csproj"
|> Seq.iter runTest