Files
garble/testdata/scripts/tiny.txt
Daniel Martí c3bee46a26 testdata: use the debugdir flag less often
In tiny.txt, we already check line numbers via stderr, so there's no
need to do that via -debugdir.

In syntax.txt, we only really care about what names remain in the
binary, not the names which remain in the source but don't affect the
binary.

These changes are important because -debugdir adds a non-trivial amount
of work, which will impede build caching once that feature lands. We
will likely make -debugdir support build caching eventually, but for
now, this preliminary change will make 'go test' much faster with build
caching.

And of course, the tests get simpler, which is nice.
2020-09-22 14:56:21 +01:00

45 lines
693 B
Plaintext

env GOPRIVATE=test/main
# Tiny mode
garble -tiny build
env GODEBUG='allocfreetrace=1,gcpacertrace=1,gctrace=1,scavenge=1,scavtrace=1,scheddetail=1,schedtrace=10'
! exec ./main$exe
cmp stdout main.stdout
stderr '\? 0'
[short] stop # no need to verify this with -short
# Default mode
env GODEBUG=
garble build
! exec ./main$exe
cmp stdout main.stdout
stderr '\w\.go [1-9]'
-- go.mod --
module test/main
-- main.go --
package main
import (
"fmt"
"runtime"
)
func main() {
defer func() {
if r := recover(); r != nil {
fmt.Println(r)
panic("oh noes")
}
}()
_, file, line, _ := runtime.Caller(0)
println(file, line)
panic("ya like jazz?")
}
-- main.stdout --
ya like jazz?