Integration tests

Run integration tests by building with coverage flags, executing with GOCOVERDIR, and analyzing results with go tool covdata.

Run integration tests by building your application with coverage enabled, executing it with the GOCOVERDIR environment variable set, and then processing the resulting profile files using go tool covdata.

mkdir ./profiledir
go build -cover -o myapp.exe .
GOCOVERDIR=./profiledir ./myapp.exe

After execution, generate a coverage report or merge profiles using the covdata tool:

go tool covdata percent -i=profiledir

For compiler-specific integration tests like stack slot merging, use the go tool compile command with debug flags:

go tool compile -p=p -c 1 -o p.a -d=mergelocalstrace=2,mergelocals=1 integration.go