-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split Standalone tests into their own category
- Loading branch information
Maxime Mangel
committed
Sep 25, 2023
1 parent
b401006
commit 1eb6288
Showing
5 changed files
with
65 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
module Build.Tests.Standalone | ||
|
||
open Build.FableLibrary | ||
open System.IO | ||
open System | ||
open BlackFox.CommandLine | ||
open Build.Utils | ||
open Build | ||
open SimpleExec | ||
|
||
let private mainTestProject = | ||
Path.Resolve("tests", "Js", "Main", "Fable.Tests.fsproj") | ||
|
||
let private mochaCommand = "npx mocha . --reporter dot -t 10000" | ||
|
||
let handleStandaloneFast () = | ||
let fableCompilerJsDir = Path.Resolve("src", "fable-compiler-js", "src") | ||
let fableCompilerJsEntry = Path.Combine(fableCompilerJsDir, "app.fs.js") | ||
let standaloneBuildDest = Path.Resolve("build", "tests", "Standalone") | ||
|
||
Command.Fable( | ||
CmdLine.appendRaw "--noCache", | ||
workingDirectory = Path.Resolve("src", "fable-standalone", "src") | ||
) | ||
|
||
Command.Fable( | ||
CmdLine.appendPrefix "--exclude" "Fable.Core" | ||
>> CmdLine.appendPrefix "--define" "LOCAL_TEST" | ||
>> CmdLine.appendRaw "--noCache", | ||
workingDirectory = fableCompilerJsDir | ||
) | ||
|
||
// Make sure the projects are restored | ||
// Otherwise, on a first VM dependencies can be missing | ||
Command.Run("dotnet", $"restore {mainTestProject}") | ||
|
||
Command.Run( | ||
"node", | ||
CmdLine.empty | ||
|> CmdLine.appendRaw fableCompilerJsEntry | ||
|> CmdLine.appendRaw mainTestProject | ||
|> CmdLine.appendRaw standaloneBuildDest | ||
|> CmdLine.toString, | ||
workingDirectory = fableCompilerJsDir | ||
) | ||
|
||
Command.Run("npx", mochaCommand, workingDirectory = standaloneBuildDest) | ||
|
||
let handle (args: string list) = | ||
handleStandaloneFast () |