mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 03:41:45 +00:00
neotest: add a warning to CompileSource, it's bad for coverage
$ go tool cover -html=coverage.txt -o coverage.html cover: can't read "/home/rik/dev/neo-go/examples/nft-nd-nns/contract.go": open /home/rik/dev/neo-go/examples/nft-nd-nns/contract.go: no such file or directory Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
594612bbdf
commit
ad41d0f9c7
1 changed files with 4 additions and 0 deletions
|
@ -26,6 +26,10 @@ type Contract struct {
|
||||||
var contracts = make(map[string]*Contract)
|
var contracts = make(map[string]*Contract)
|
||||||
|
|
||||||
// CompileSource compiles a contract from the reader and returns its NEF, manifest and hash.
|
// CompileSource compiles a contract from the reader and returns its NEF, manifest and hash.
|
||||||
|
// Compiled contract will have "contract.go" used for its file name and coverage
|
||||||
|
// data collection can give wrong results for it, so it's recommended to disable
|
||||||
|
// coverage ([*Executor.DisableCoverage]) when you're deploying contracts
|
||||||
|
// compiled via this function.
|
||||||
func CompileSource(t testing.TB, sender util.Uint160, src io.Reader, opts *compiler.Options) *Contract {
|
func CompileSource(t testing.TB, sender util.Uint160, src io.Reader, opts *compiler.Options) *Contract {
|
||||||
// nef.NewFile() cares about version a lot.
|
// nef.NewFile() cares about version a lot.
|
||||||
config.Version = "neotest"
|
config.Version = "neotest"
|
||||||
|
|
Loading…
Reference in a new issue