-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlakefile.lean
More file actions
36 lines (28 loc) · 1 KB
/
lakefile.lean
File metadata and controls
36 lines (28 loc) · 1 KB
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
import Lake
open Lake DSL
package "hopscotch" where
version := v!"1.0.0"
lean_lib Hopscotch
lean_lib HopscotchTestLib
@[default_target]
lean_exe "hopscotch" where
root := `Main
lean_exe HopscotchTest where
root := `HopscotchTest.Main
lean_exe HopscotchMockLake where
root := `HopscotchMockLake.Main
/-- Build the mock lake helper and test executable, then run the tests with the helper path wired in. -/
@[test_driver] script test (args) do
let ws ← getWorkspace
let some mockLakeExe := ws.findLeanExe? `HopscotchMockLake
| error "missing test helper executable `HopscotchMockLake`"
let mockLakeExeFile ← ws.runBuild mockLakeExe.fetch
let some testExe := ws.findLeanExe? `HopscotchTest
| error "missing test executable `HopscotchTest`"
let testExeFile ← ws.runBuild testExe.fetch
let child ← IO.Process.spawn {
cmd := testExeFile.toString
args := args.toArray
env := (← getAugmentedEnv).push ("HOPSCOTCH_MOCK_LAKE_EXE", some mockLakeExeFile.toString)
}
child.wait