diff --git a/covertest/cover.go b/covertest/cover.go index c76acc3..9d7a2e3 100644 --- a/covertest/cover.go +++ b/covertest/cover.go @@ -4,12 +4,15 @@ import ( "fmt" "os" "strings" + "sync" "testing" "github.com/nspcc-dev/neo-go/pkg/compiler" "github.com/stretchr/testify/require" ) +var mu sync.Mutex + type coverline struct { Doc string Opcode int @@ -91,6 +94,9 @@ func countInstructions(cov []coverline, codes []InstrHash) { } func printToFile(t testing.TB, cov []coverline, name string) { + mu.Lock() + defer mu.Unlock() + f, err := os.OpenFile(name, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600) require.NoError(t, err)