forked from bytecodealliance/wasmtime-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_test.go
36 lines (33 loc) · 1.11 KB
/
config_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package wasmtime
import (
"runtime"
"testing"
"github.com/stretchr/testify/require"
)
func TestConfig(t *testing.T) {
NewConfig().SetDebugInfo(true)
NewConfig().SetMaxWasmStack(8388608)
NewConfig().SetWasmThreads(true)
NewConfig().SetWasmReferenceTypes(true)
NewConfig().SetWasmSIMD(true)
NewConfig().SetWasmBulkMemory(true)
NewConfig().SetWasmMultiValue(true)
NewConfig().SetWasmMultiMemory(true)
NewConfig().SetConsumeFuel(true)
NewConfig().SetStrategy(StrategyAuto)
NewConfig().SetStrategy(StrategyCranelift)
NewConfig().SetCraneliftDebugVerifier(true)
NewConfig().SetCraneliftOptLevel(OptLevelNone)
NewConfig().SetCraneliftOptLevel(OptLevelSpeed)
NewConfig().SetCraneliftOptLevel(OptLevelSpeedAndSize)
NewConfig().SetProfiler(ProfilingStrategyNone)
if runtime.GOARCH == "amd64" && runtime.GOOS == "linux" {
NewConfig().SetTarget("x86_64-unknown-linux-gnu")
}
NewConfig().SetCraneliftFlag("opt_level", "none")
NewConfig().EnableCraneliftFlag("unwind_info")
err := NewConfig().CacheConfigLoadDefault()
require.NoError(t, err)
err = NewConfig().CacheConfigLoad("nonexistent.toml")
require.Error(t, err)
}