aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/state_test.go5
-rw-r--r--tests/state_test_util.go6
-rw-r--r--tests/vm_test.go5
-rw-r--r--tests/vm_test_util.go8
4 files changed, 12 insertions, 12 deletions
diff --git a/tests/state_test.go b/tests/state_test.go
index eb1900e1b..7090b0541 100644
--- a/tests/state_test.go
+++ b/tests/state_test.go
@@ -27,14 +27,13 @@ import (
func init() {
if os.Getenv("JITVM") == "true" {
vm.ForceJit = true
- } else {
- vm.DisableJit = true
+ vm.EnableJit = true
}
}
func BenchmarkStateCall1024(b *testing.B) {
fn := filepath.Join(stateTestDir, "stCallCreateCallCodeTest.json")
- if err := BenchVmTest(fn, bconf{"Call1024BalanceTooLow", true, false}, b); err != nil {
+ if err := BenchVmTest(fn, bconf{"Call1024BalanceTooLow", true, os.Getenv("JITVM") == "true"}, b); err != nil {
b.Error(err)
}
}
diff --git a/tests/state_test_util.go b/tests/state_test_util.go
index 695e50852..def9b0c36 100644
--- a/tests/state_test_util.go
+++ b/tests/state_test_util.go
@@ -71,8 +71,8 @@ func BenchStateTest(p string, conf bconf, b *testing.B) error {
return fmt.Errorf("test not found: %s", conf.name)
}
- pNoJit := vm.DisableJit
- vm.DisableJit = conf.nojit
+ pJit := vm.EnableJit
+ vm.EnableJit = conf.jit
pForceJit := vm.ForceJit
vm.ForceJit = conf.precomp
@@ -94,7 +94,7 @@ func BenchStateTest(p string, conf bconf, b *testing.B) error {
benchStateTest(test, env, b)
}
- vm.DisableJit = pNoJit
+ vm.EnableJit = pJit
vm.ForceJit = pForceJit
return nil
diff --git a/tests/vm_test.go b/tests/vm_test.go
index afa1424d5..96718db3c 100644
--- a/tests/vm_test.go
+++ b/tests/vm_test.go
@@ -17,20 +17,21 @@
package tests
import (
+ "os"
"path/filepath"
"testing"
)
func BenchmarkVmAckermann32Tests(b *testing.B) {
fn := filepath.Join(vmTestDir, "vmPerformanceTest.json")
- if err := BenchVmTest(fn, bconf{"ackermann32", true, false}, b); err != nil {
+ if err := BenchVmTest(fn, bconf{"ackermann32", true, os.Getenv("JITVM") == "true"}, b); err != nil {
b.Error(err)
}
}
func BenchmarkVmFibonacci16Tests(b *testing.B) {
fn := filepath.Join(vmTestDir, "vmPerformanceTest.json")
- if err := BenchVmTest(fn, bconf{"fibonacci16", true, false}, b); err != nil {
+ if err := BenchVmTest(fn, bconf{"fibonacci16", true, os.Getenv("JITVM") == "true"}, b); err != nil {
b.Error(err)
}
}
diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go
index b29dcd20f..71a4f5e33 100644
--- a/tests/vm_test_util.go
+++ b/tests/vm_test_util.go
@@ -52,7 +52,7 @@ func RunVmTestWithReader(r io.Reader, skipTests []string) error {
type bconf struct {
name string
precomp bool
- nojit bool
+ jit bool
}
func BenchVmTest(p string, conf bconf, b *testing.B) error {
@@ -67,8 +67,8 @@ func BenchVmTest(p string, conf bconf, b *testing.B) error {
return fmt.Errorf("test not found: %s", conf.name)
}
- pNoJit := vm.DisableJit
- vm.DisableJit = conf.nojit
+ pJit := vm.EnableJit
+ vm.EnableJit = conf.jit
pForceJit := vm.ForceJit
vm.ForceJit = conf.precomp
@@ -99,7 +99,7 @@ func BenchVmTest(p string, conf bconf, b *testing.B) error {
benchVmTest(test, env, b)
}
- vm.DisableJit = pNoJit
+ vm.EnableJit = pJit
vm.ForceJit = pForceJit
return nil