forked from hofstadter-io/hof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cue
113 lines (96 loc) · 1.75 KB
/
test.cue
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package hof
import "strings"
//
////// Defined (partially) test configuration
//
#GoBaseTest: {
skip: bool | *false
sysenv: bool | *false
env?: [string]: string
args?: [...string]
verbose?: bool | int
dir: string
...
}
#GoBashTest: #GoBaseTest & {
dir: string
script: string | *"""
rm -rf .workdir
go test -cover ./
"""
...
}
#GoBashCover: #GoBaseTest & {
dir: string
back: strings.Repeat("../", strings.Count(dir, "/") + 1)
script: string | *"""
rm -rf .workdir
go test -cover ./ -coverprofile cover.out -json > tests.json
"""
...
}
//
////// Actual test configuration
//
// Test generated code
gen: _ @test(suite,gen)
gen: {
// TODO before / after
cmds: #GoBashTest @test(bash,test,cmd)
cmds: {
dir: "cmd/hof/cmd"
}
cmdsC: #GoBashCover @test(bash,cover,cmd)
cmdsC: {
dir: "cmd/hof/cmd"
}
}
// Test Hof Linear Script (hls)
hls: _ @test(suite,hls)
hls: {
runtime: #GoBashTest @test(bash,test,runtime)
runtime: {
dir: "script/runtime"
}
runtimeC: #GoBashCover @test(bash,cover,runtime)
runtimeC: {
dir: "script/runtime"
}
shell: #GoBashTest @test(bash,test,shell)
shell: {
dir: "script/shell"
}
shellC: #GoBashCover @test(bash,cover,shell)
shellC: {
dir: "script/shell"
}
script: #GoBashTest @test(bash,test,script)
script: {
dir: "script"
}
scriptC: #GoBashCover @test(bash,cover,script)
scriptC: {
dir: "script"
}
}
lib: _ @test(suite,lib)
lib: {
mod: #GoBashTest @test(bash,test,mod)
mod: {
dir: "lib/mod"
}
modC: #GoBashCover @test(bash,cover,mod)
modC: {
dir: "lib/mod"
}
st: #GoBashTest @test(bash,test,st)
st: #GoBashTest & {
dir: "lib/structural"
// temp to isolate
script: "go test -v -cover pick_test.go"
}
stC: #GoBashCover @test(bash,cover,st)
stC: {
dir: "lib/structural"
}
}