Skip to content

Commit 3f706ad

Browse files
committed
correct tests
1 parent 132d72a commit 3f706ad

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Diff for: jscomp/build_tests/ns/input.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bsb && echo $?
1+
bsb

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"scripts": {
3232
"test": "go build -o test.exe scripts/test.go && ./test.exe",
3333
"test-theme" : "go run scripts/test.go -no-install-global -no-ounit -no-mocha -no-bsb",
34+
"test-bsb" : "go run scripts/test.go -no-install-global -no-ounit -no-mocha -no-theme",
3435
"wtest": "mocha './jscomp/test/**/*test.js' -R spec -w",
3536
"cover": "istanbul cover --report html ./node_modules/.bin/_mocha -- ./jscomp/test/**/*test.js && open coverage/index.html",
3637
"coverage": "istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- './jscomp/test/*test.js' -R spec",

Diff for: scripts/test.go

+12-4
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ func fatalError(err error) {
167167
panic(err)
168168
}
169169
}
170-
func bsbInDir(dir string) {
170+
func bsbInDir(builddir, dir string) {
171171

172-
destDir := filepath.Join("jscomp", "build_tests", dir)
172+
destDir := filepath.Join(builddir, dir)
173173
pattern, err := ioutil.ReadFile(filepath.Join(destDir, "output.ref"))
174174
fatalError(err)
175175
argsB, err := ioutil.ReadFile(filepath.Join(destDir, "input.sh"))
@@ -189,7 +189,7 @@ func bsbInDir(dir string) {
189189
fmt.Println("Failure to match", pattern)
190190

191191
}
192-
192+
fmt.Println("failed in ",dir)
193193
outS := string(out)
194194
fmt.Println(outS)
195195
fmt.Println(err)
@@ -257,6 +257,14 @@ func main() {
257257
wg.Wait()
258258
}
259259
if !*noBsbTest {
260-
bsbInDir("in_source")
260+
buildTestDir := filepath.Join("jscomp","build_tests")
261+
files, err := ioutil.ReadDir(buildTestDir)
262+
checkError(err)
263+
264+
for _, file := range files {
265+
if file.IsDir(){
266+
bsbInDir(buildTestDir,file.Name())
267+
}
268+
}
261269
}
262270
}

0 commit comments

Comments
 (0)