-
Notifications
You must be signed in to change notification settings - Fork 80
/
config_test.go
47 lines (44 loc) · 1.55 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
37
38
39
40
41
42
43
44
45
46
47
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().SetWasmRelaxedSIMD(true)
NewConfig().SetWasmRelaxedSIMDDeterministic(true)
NewConfig().SetWasmBulkMemory(true)
NewConfig().SetWasmMultiValue(true)
NewConfig().SetWasmMultiMemory(true)
NewConfig().SetWasmTailCall(true)
NewConfig().SetWasmFunctionReferences(true)
NewConfig().SetWasmGC(true)
NewConfig().SetWasmWideArithmetic(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)
NewConfig().SetParallelCompilation(true)
NewConfig().SetCraneliftNanCanonicalization(true)
NewConfig().SetNativeUnwindInfo(true)
NewConfig().SetMacOSUseMachPorts(false)
NewConfig().SetMemoryInitCOWSet(true)
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)
}