smartystreets / goconvey

Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
http://smartystreets.github.io/goconvey/
Other
8.23k stars 554 forks source link

Does `goconvey` support executing `goconvey` without inline? #683

Open HuLing1025 opened 9 months ago

HuLing1025 commented 9 months ago

Iike below, this is code intrusion when I stub functions in my project. Is there any way to exec web UI command goconvey gracefully?

//go:noinline
func GetResult(d Demo) string {
    if d.GetMsg() == "store" {
        return "success"
    }
    return "failure"
}

The official way:

 go test -gcflags=all=-l
HuLing1025 commented 8 months ago

I solved the problem by adding the following code, then rebuilding, and then replacing the goconvey.exe file in the bin directory.

// web/server/system/shell.go runWithCoverage
arguments = append(arguments, "-gcflags=all=-l")
DraftTin commented 2 months ago

I edited the source file and ran go install github.com/smartystreets/goconvey. It didn't work for me.