summaryrefslogtreecommitdiff
path: root/test/unit/test_memory_packing.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_memory_packing.py')
-rw-r--r--test/unit/test_memory_packing.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/unit/test_memory_packing.py b/test/unit/test_memory_packing.py
index c8c331800..357752f10 100644
--- a/test/unit/test_memory_packing.py
+++ b/test/unit/test_memory_packing.py
@@ -1,12 +1,13 @@
import os
-from scripts.test.shared import WASM_OPT, run_process
-from .utils import BinaryenTestCase
+
+from scripts.test import shared
+from . import utils
"""Test that MemoryPacking correctly respects the web limitations by not
generating more than 100K data segments"""
-class MemoryPackingTest(BinaryenTestCase):
+class MemoryPackingTest(utils.BinaryenTestCase):
def test_large_segment(self):
data = '"' + (('A' + ('\\00' * 9)) * 100001) + '"'
module = '''
@@ -17,8 +18,8 @@ class MemoryPackingTest(BinaryenTestCase):
''' % data
opts = ['--memory-packing', '--disable-bulk-memory', '--print',
'-o', os.devnull]
- p = run_process(WASM_OPT + opts, input=module, check=False,
- capture_output=True)
+ p = shared.run_process(shared.WASM_OPT + opts, input=module,
+ check=False, capture_output=True)
output = [
'(data (i32.const 999970) "A")',
'(data (i32.const 999980) "A")',
@@ -33,8 +34,8 @@ class MemoryPackingTest(BinaryenTestCase):
module = '(module (memory 256 256) %s)' % data
opts = ['--memory-packing', '--enable-bulk-memory', '--print',
'-o', os.devnull]
- p = run_process(WASM_OPT + opts, input=module, check=False,
- capture_output=True)
+ p = shared.run_process(shared.WASM_OPT + opts, input=module,
+ check=False, capture_output=True)
self.assertEqual(p.returncode, 0)
self.assertIn('Some VMs may not accept this binary', p.stderr)
self.assertIn('Run the limit-segments pass to merge segments.', p.stderr)