@@ -11,40 +11,7 @@ import (
11
11
12
12
const WorkDir = "work"
13
13
14
- var allTypes = []microsmith.Type {
15
- microsmith.BasicType {"bool" },
16
- microsmith.BasicType {"byte" },
17
- microsmith.BasicType {"int" },
18
- microsmith.BasicType {"int8" },
19
- microsmith.BasicType {"int16" },
20
- microsmith.BasicType {"int32" },
21
- microsmith.BasicType {"int64" },
22
- microsmith.BasicType {"uint" },
23
- microsmith.BasicType {"float32" },
24
- microsmith.BasicType {"float64" },
25
- microsmith.BasicType {"complex128" },
26
- microsmith.BasicType {"rune" },
27
- microsmith.BasicType {"string" },
28
- }
29
-
30
- var TestConfigurations = map [string ]microsmith.ProgramConf {
31
- "small" : {
32
- MultiPkg : false ,
33
- },
34
-
35
- "medium" : {
36
- MultiPkg : false ,
37
- },
38
-
39
- "big" : {
40
- MultiPkg : false ,
41
- },
42
- "huge" : {
43
- MultiPkg : false ,
44
- },
45
- }
46
-
47
- // check n generated programs with go/types (in-memory)
14
+ // check n generated programs with go/types
48
15
func testProgramGoTypes (t * testing.T , n int , conf microsmith.ProgramConf ) {
49
16
for i := 0 ; i < n ; i ++ {
50
17
gp := microsmith .NewProgram (conf )
@@ -59,68 +26,26 @@ func testProgramGoTypes(t *testing.T, n int, conf microsmith.ProgramConf) {
59
26
}
60
27
}
61
28
62
- func TestRandConf (t * testing.T ) {
63
- n := 10
29
+ func TestNewProgram (t * testing.T ) {
30
+ n := 50
64
31
if testing .Short () {
65
- n = 5
66
- }
67
- for i := 0 ; i < 10 ; i ++ {
68
- // no multipkg, no typeparams
69
- testProgramGoTypes (t , n , microsmith.ProgramConf {})
32
+ n = 10
70
33
}
34
+ testProgramGoTypes (t , n , microsmith.ProgramConf {})
71
35
}
72
36
73
- func TestRandConfTypeParams (t * testing.T ) {
74
- n := 10
37
+ func TestNewProgramTP (t * testing.T ) {
38
+ n := 50
75
39
if testing .Short () {
76
- n = 5
77
- }
78
- for i := 0 ; i < 10 ; i ++ {
79
- testProgramGoTypes (
80
- t , n ,
81
- microsmith.ProgramConf {
82
- MultiPkg : false ,
83
- TypeParams : true ,
84
- })
40
+ n = 10
85
41
}
86
- }
87
-
88
- func TestSmall (t * testing.T ) {
89
- lim := 100
90
- if testing .Short () {
91
- lim = 10
92
- }
93
- testProgramGoTypes (t , lim , TestConfigurations ["small" ])
94
- }
95
-
96
- func TestMedium (t * testing.T ) {
97
- lim := 100
98
- if testing .Short () {
99
- lim = 10
100
- }
101
- testProgramGoTypes (t , lim , TestConfigurations ["medium" ])
102
- }
103
42
104
- func TestBig (t * testing.T ) {
105
- lim := 10
106
- if testing .Short () {
107
- lim = 2
108
- }
109
- testProgramGoTypes (t , lim , TestConfigurations ["big" ])
110
- }
111
-
112
- func TestHuge (t * testing.T ) {
113
- lim := 5
114
- if testing .Short () {
115
- lim = 1
116
- }
117
- testProgramGoTypes (t , lim , TestConfigurations ["huge" ])
118
- }
119
-
120
- func TestTypeParams (t * testing.T ) {
121
- conf := TestConfigurations ["medium" ]
122
- conf .TypeParams = true
123
- testProgramGoTypes (t , 50 , conf )
43
+ testProgramGoTypes (
44
+ t , n ,
45
+ microsmith.ProgramConf {
46
+ MultiPkg : false ,
47
+ TypeParams : true ,
48
+ })
124
49
}
125
50
126
51
func GetToolchain () string {
0 commit comments