cmd/evm: init testing package

This commit is contained in:
Martin Holst Swende 2024-11-26 16:09:39 +01:00
parent 6342d59d56
commit 99d915d122
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -84,6 +84,7 @@ type execStats struct {
func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) ([]byte, execStats, error) { func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) ([]byte, execStats, error) {
if bench { if bench {
testing.Init()
// Do one warm-up run // Do one warm-up run
output, gasUsed, err := execFunc() output, gasUsed, err := execFunc()
result := testing.Benchmark(func(b *testing.B) { result := testing.Benchmark(func(b *testing.B) {