-
Notifications
You must be signed in to change notification settings - Fork 300
/
Integration.fs
46 lines (33 loc) · 1.48 KB
/
Integration.fs
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
36
37
38
39
40
41
42
43
44
45
46
module Build.Test.Integration
open Build.FableLibrary
open System.IO
open System
open BlackFox.CommandLine
open Build.Utils
open Build
open SimpleExec
let private integrationProjectDir =
Path.Resolve("tests", "Integration", "Integration")
let private compilerProjectDir = Path.Resolve("tests", "Integration", "Compiler")
let private testProjectConfig (projectDirName: string) (configuration: string option) =
let projectDir =
Path.Resolve("tests", "Integration", "ProjectConfigs", projectDirName)
let destinationDir =
Path.Resolve("temp", "tests", "Integration", "ProjectConfigs", projectDirName)
Directory.clean destinationDir
let fableArgs =
CmdLine.empty
|> CmdLine.appendRaw projectDir
|> CmdLine.appendPrefix "--outDir" destinationDir
|> CmdLine.appendPrefix "--exclude" "Fable.Core"
|> CmdLine.appendPrefixIfSome "--configuration" configuration
Command.Fable(fableArgs)
Command.Run("npx", "npx mocha . --reporter dot -t 10000", workingDirectory = destinationDir)
let handle (args: string list) =
BuildFableLibraryJavaScript().Run()
Command.Run("dotnet", "run -c Release", workingDirectory = integrationProjectDir)
Command.Run("dotnet", "run -c Release", workingDirectory = compilerProjectDir)
testProjectConfig "DebugWithExtraDefines" (Some "Debug")
testProjectConfig "CustomConfiguration" (Some "Test")
testProjectConfig "ReleaseNoExtraDefines" None
testProjectConfig "ConsoleApp" None