Coverage for tests/test_config.py: 100%
42 statements
« prev ^ index » next coverage.py v7.6.12, created at 2025-02-20 16:25 +0000
« prev ^ index » next coverage.py v7.6.12, created at 2025-02-20 16:25 +0000
1import unittest
2from contextlib import closing
4from wasmtime import *
7class TestConfig(unittest.TestCase):
8 def test_smoke(self):
9 config = Config()
10 config.debug_info = True
11 config.wasm_threads = True
12 config.wasm_tail_call = True
13 config.wasm_reference_types = True
14 config.wasm_simd = True
15 config.wasm_bulk_memory = True
16 config.wasm_multi_value = True
17 config.wasm_multi_memory = True
18 config.wasm_memory64 = True
19 config.cranelift_debug_verifier = True
20 config.strategy = "cranelift"
21 config.strategy = "auto"
22 config.cache = True
23 config.parallel_compilation = False
24 with self.assertRaises(WasmtimeError):
25 config.cache = "./test.toml"
26 with self.assertRaises(WasmtimeError):
27 config.strategy = "nonexistent-strategy"
28 config.cranelift_opt_level = "none"
29 config.cranelift_opt_level = "speed_and_size"
30 config.cranelift_opt_level = "speed"
31 with self.assertRaises(WasmtimeError):
32 config.cranelift_opt_level = "nonexistent-level"
33 config.profiler = "none"
34 with self.assertRaises(WasmtimeError):
35 config.profiler = "nonexistent-profiler"
36 config.consume_fuel = True
37 config.wasm_relaxed_simd = True
38 config.wasm_relaxed_simd_deterministic = True
40 with closing(config) as config:
41 pass
43 config.close()
45 with self.assertRaises(ValueError):
46 Engine(config)
48 with self.assertRaises(ValueError):
49 config.cache = True