-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest.cue
97 lines (79 loc) · 1.31 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
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
//
cli: {
@test(suite,cli)
test_all: #GoBashTest @test(bash,test)
test_all: {
dir: "test/cli"
}
cover_all: #GoBashCover @test(bash,cover)
cover_all: {
dir: "test/cli"
}
}
lib: {
@test(suite,lib)
test_all: #GoBashTest @test(bash,test)
test_all: {
dir: "structural"
}
cover_all: #GoBashCover @test(bash,cover)
cover_all: {
dir: "structural"
}
}
pipeline: {
@test(suite,pipeline)
test_all: #GoBashTest @test(bash,test)
test_all: {
dir: "test/pipeline"
}
cover_all: #GoBashCover @test(bash,cover)
cover_all: {
dir: "test/pipeline"
}
}
cue: {
@test(suite,cue)
eval: _ @test(bash,test)
eval: {
dir: "test/cue"
script: """
for file in `ls *.cue`; do
cue eval $file > /dev/null
done
"""
}
}