myitcv / gopherjs

A compiler from Go to JavaScript for running Go code in a browser
BSD 2-Clause "Simplified" License
21 stars 0 forks source link

gopherjs test should behave like go test with no test files #40

Open myitcv opened 5 years ago

myitcv commented 5 years ago

Given the testscript:

env HOME=$WORK/home
mkdir $HOME
env GOPATH=$WORK/go
go mod edit -require=github.com/gopherjs/gopherjs@v0.0.0 -replace=github.com/gopherjs/gopherjs=$SELF

go mod download

# go
! go test

# gopherjs
! gopherjs test

-- go.mod --
module mod

-- blah.go --
package blah

var _ = asdf

We get the following failure:

$ go test -run="TestScripts/test_no_tests"
--- FAIL: TestScripts (0.04s)
    --- FAIL: TestScripts/test_no_tests (0.33s)
        testscript.go:228:
            # go (0.067s)
            # gopherjs (0.189s)
            > ! gopherjs test
            [stdout]
            ?           mod     [no test files]
            FAIL: testdata/test_no_tests.txt:12: unexpected command success

FAIL
exit status 1
FAIL    github.com/gopherjs/gopherjs    0.411s
myitcv commented 5 years ago

Spotted originally in https://github.com/gopherjs/gopherjs/issues/883#issuecomment-445014908