@@ -3,6 +3,7 @@ package main
3
3
import (
4
4
"flag"
5
5
"fmt"
6
+ "io/ioutil"
6
7
"log"
7
8
"os"
8
9
"os/exec"
@@ -11,7 +12,6 @@ import (
11
12
"strings"
12
13
"sync"
13
14
"time"
14
- "io/ioutil"
15
15
)
16
16
17
17
type command struct {
@@ -94,9 +94,9 @@ func commandString(name string) command {
94
94
return makeCommand (name , xs [0 ], xs [1 :]... )
95
95
96
96
}
97
- func checkError (err error ) {
97
+ func checkError ( err error , theme ... string ) {
98
98
if err != nil {
99
- log .Fatalf ("Error: %s " , err .Error ())
99
+ log .Fatalf ("Error:%v \n ==== \n %s \n ==== \n " , theme , err .Error ())
100
100
}
101
101
}
102
102
@@ -107,15 +107,16 @@ func testTheme(theme string) {
107
107
output , err := cmd .CombinedOutput ()
108
108
109
109
fmt .Println (string (output ))
110
- checkError (err )
110
+ checkError (err , theme )
111
111
112
- fmt .Println ("Started to build " )
112
+ fmt .Println ("Started to build " , theme )
113
113
cmd2 := exec .Command ("npm" , "run" , "build" )
114
114
cmd2 .Dir = theme
115
115
output2 , err := cmd2 .CombinedOutput ()
116
116
fmt .Println (string (output2 ))
117
- checkError (err )
117
+ checkError (err , theme )
118
118
os .RemoveAll (theme )
119
+ fmt .Println ("Finish building" ,theme )
119
120
}
120
121
121
122
func runMoCha (wg * sync.WaitGroup ) {
@@ -153,20 +154,20 @@ func init() {
153
154
os .Setenv ("PATH" ,
154
155
vendorOCamlPath + string (os .PathListSeparator )+ os .Getenv ("PATH" ))
155
156
}
156
- func fatalError (err error ){
157
- if err != nil {
158
- panic (err )
157
+ func fatalError (err error ) {
158
+ if err != nil {
159
+ panic (err )
159
160
}
160
161
}
161
162
func bsbInDir (dir string ) {
162
-
163
+
163
164
destDir := filepath .Join ("jscomp" , "build_tests" , dir )
164
- pattern , err := ioutil .ReadFile (filepath .Join (destDir ,"output.ref" ))
165
- fatalError (err )
166
- argsB , err := ioutil .ReadFile (filepath .Join (destDir ,"input.sh" ))
165
+ pattern , err := ioutil .ReadFile (filepath .Join (destDir , "output.ref" ))
166
+ fatalError (err )
167
+ argsB , err := ioutil .ReadFile (filepath .Join (destDir , "input.sh" ))
167
168
fatalError (err )
168
169
args := strings .Fields (strings .TrimSpace (string (argsB )))
169
-
170
+
170
171
patternS := string (pattern )
171
172
c := cmd (args [0 ], args [1 :]... )
172
173
c .Dir = destDir
@@ -193,7 +194,7 @@ func main() {
193
194
noOunitTest := flag .Bool ("no-ounit" , false , "don't do ounit test" )
194
195
noMochaTest := flag .Bool ("no-mocha" , false , "don't run mocha" )
195
196
noThemeTest := flag .Bool ("no-theme" , false , "no bsb theme test" )
196
-
197
+ noBsbTest := flag . Bool ( "no-bsb" , false , "no bsb test" )
197
198
// disableAll := flag.Bool("disable-all", false, "disable all tets")
198
199
flag .Parse ()
199
200
@@ -240,6 +241,7 @@ func main() {
240
241
}
241
242
wg .Wait ()
242
243
}
243
-
244
- bsbInDir ("in_source" )
244
+ if ! * noBsbTest {
245
+ bsbInDir ("in_source" )
246
+ }
245
247
}
0 commit comments