Skip to content

Commit d6d14e0

Browse files
committed
tests
1 parent 8bcfaad commit d6d14e0

File tree

4 files changed

+31
-29
lines changed

4 files changed

+31
-29
lines changed

Diff for: scripts/config_compiler.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Generated by BUCKLESCRIPT VERSION 1.8.1, PLEASE EDIT WITH CARE
21
'use strict';
32

43
var Fs = require("fs");
@@ -159,7 +158,7 @@ if (match$1) {
159158
Process.exit(2);
160159
}
161160
} else {
162-
console.log("System-installed OCaml compiler version not found\nBuilding and installing local compiler");
161+
console.log("System-installed OCaml compiler version not found");
163162
Process.exit(2);
164163
}
165164

Diff for: scripts/config_compiler.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ let () =
153153
config_map is_windows
154154
else Process.exit 2
155155
| None ->
156-
(Js.log("System-installed OCaml compiler version not found\nBuilding and installing local compiler");
156+
(Js.log("System-installed OCaml compiler version not found");
157157
Process.exit 2)
158158

159159

Diff for: scripts/install.js

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function non_windows_npm_release() {
8888
try {
8989
child_process.execSync('node ../scripts/config_compiler.js', working_config)
9090
} catch (e) {
91+
console.log('Build a local version of OCaml compiler, it may take a couple of minutes')
9192
child_process.execSync(path.join(__dirname, 'buildocaml.sh')) // TODO: sh -c ? this will be wrong if we have white space in the path
9293
console.log('configure again with local ocaml installed')
9394
child_process.execSync('node ../scripts/config_compiler.js', working_config)

Diff for: test.go

+28-26
Original file line numberDiff line numberDiff line change
@@ -167,34 +167,36 @@ func main() {
167167
// // makeCommand("make", "-C", filepath.Join("jscomp","test")),
168168
// })
169169

170-
cmd:=cmd ("make", "-C", "jscomp","travis-world-test")
171-
cmd.Stdout = os.Stdout
172-
cmd.Stderr = os.Stderr
173-
error:= cmd.Run()
174-
if error!= nil {
175-
170+
make:=cmd ("make", "-C", "jscomp","travis-world-test")
171+
make.Stdout = os.Stdout
172+
make.Stderr = os.Stderr
173+
error:= make.Run()
174+
if error!= nil {
176175
os.Exit(2)
177176
}
178177

178+
ginstall := cmd("npm", "i", "-g", ".")
179+
fmt.Println("install bucklescript globally")
180+
error = ginstall.Run()
181+
if error != nil {
182+
log.Fatalf("install failed")
183+
} else {
184+
fmt.Println("install finished")
185+
}
186+
bsbDir, _ := cmd("bsb", "-where").CombinedOutput ()
187+
fmt.Println("BSBDIR:", string(bsbDir))
188+
bsb, _ := cmd("ls", "-al", filepath.Dir( string (bsbDir))).CombinedOutput()
189+
fmt.Println("BSB isntallation:", string(bsb ))
190+
179191

180-
// bsbDir, _ := cmd("bsb", "-where").CombinedOutput ()
181-
// fmt.Println("BSBDIR:", string(bsbDir))
182-
// bsb, _ := cmd("ls", "-al", filepath.Dir( string (bsbDir))).CombinedOutput()
183-
// fmt.Println("BSB isntallation:", string(bsb ))
184-
185-
// wg.Add(2)
186-
// runMoCha(&wg)
187-
// go installGlobal(&wg)
188-
// wg.Wait()
189-
190-
// var wg sync.WaitGroup
191-
// for _, theme := range []string{"basic", "basic-reason", "generator", "minimal"} {
192-
// fmt.Println("Test theme", theme)
193-
// wg.Add(1)
194-
// go (func(theme string) {
195-
// defer wg.Done()
196-
// testTheme(theme)
197-
// })(theme)
198-
// }
199-
// wg.Wait()
192+
var wg sync.WaitGroup
193+
for _, theme := range []string{"basic", "basic-reason", "generator", "minimal"} {
194+
fmt.Println("Test theme", theme)
195+
wg.Add(1)
196+
go (func(theme string) {
197+
defer wg.Done()
198+
testTheme(theme)
199+
})(theme)
200+
}
201+
wg.Wait()
200202
}

0 commit comments

Comments
 (0)