Commit 22b8756e authored by protolambda's avatar protolambda

mipsevm: log long-running test time

parent 31d7c1ff
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"os" "os"
"path" "path"
"testing" "testing"
"time"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/hexutil"
...@@ -158,6 +159,7 @@ func TestMinimalEVM(t *testing.T) { ...@@ -158,6 +159,7 @@ func TestMinimalEVM(t *testing.T) {
//env.Config.Tracer = logger.NewMarkdownLogger(&logger.Config{}, os.Stdout) //env.Config.Tracer = logger.NewMarkdownLogger(&logger.Config{}, os.Stdout)
env.Config.Tracer = mipsSrcMap.Tracer(os.Stdout) env.Config.Tracer = mipsSrcMap.Tracer(os.Stdout)
start := time.Now()
for i := 0; i < 400_000; i++ { for i := 0; i < 400_000; i++ {
if us.state.Exited { if us.state.Exited {
break break
...@@ -192,6 +194,9 @@ func TestMinimalEVM(t *testing.T) { ...@@ -192,6 +194,9 @@ func TestMinimalEVM(t *testing.T) {
require.Equal(t, hexutil.Bytes(uniPost).String(), hexutil.Bytes(evmPost).String(), require.Equal(t, hexutil.Bytes(uniPost).String(), hexutil.Bytes(evmPost).String(),
"unicorn produced different state than EVM") "unicorn produced different state than EVM")
} }
end := time.Now()
delta := end.Sub(start)
t.Logf("test took %s, %d instructions, %s per instruction", delta, state.Step, delta/time.Duration(state.Step))
require.True(t, state.Exited, "must complete program") require.True(t, state.Exited, "must complete program")
require.Equal(t, uint8(0), state.ExitCode, "exit with 0") require.Equal(t, uint8(0), state.ExitCode, "exit with 0")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment