summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/passes/flatten.bin.txt2
-rw-r--r--test/passes/flatten.wasmbin458 -> 458 bytes
-rw-r--r--test/unit/test_asyncify.py4
-rw-r--r--test/unit/test_datacount.py2
-rw-r--r--test/unit/test_features.py2
-rw-r--r--test/unit/test_memory_packing.py2
-rw-r--r--test/unit/test_parsing_error.py2
-rw-r--r--test/unit/test_tail_call_type.py2
-rw-r--r--test/unit/utils.py7
-rw-r--r--test/wasm2js/comments.2asm.js30
10 files changed, 11 insertions, 42 deletions
diff --git a/test/passes/flatten.bin.txt b/test/passes/flatten.bin.txt
index e030c825a..d0e2fa944 100644
--- a/test/passes/flatten.bin.txt
+++ b/test/passes/flatten.bin.txt
@@ -15,7 +15,7 @@
(export "type-local-f64" (func $3))
(export "type-param-i32" (func $4))
(export "type-param-i64" (func $5))
- (export "tÿÿe-param-f32" (func $6))
+ (export "type-param-f32" (func $6))
(export "type-param-f64" (func $7))
(export "type-mixed" (func $8))
(export "read" (func $9))
diff --git a/test/passes/flatten.wasm b/test/passes/flatten.wasm
index 0ba6a86fe..fd3e0e7dd 100644
--- a/test/passes/flatten.wasm
+++ b/test/passes/flatten.wasm
Binary files differ
diff --git a/test/unit/test_asyncify.py b/test/unit/test_asyncify.py
index 40ee160d2..3856c262d 100644
--- a/test/unit/test_asyncify.py
+++ b/test/unit/test_asyncify.py
@@ -2,7 +2,7 @@ import os
import subprocess
from scripts.test.shared import WASM_OPT, WASM_DIS, WASM_SHELL, NODEJS, run_process
-from utils import BinaryenTestCase
+from .utils import BinaryenTestCase
class AsyncifyTest(BinaryenTestCase):
@@ -26,7 +26,7 @@ class AsyncifyTest(BinaryenTestCase):
run_process(WASM_OPT + [self.input_path('asyncify-pure.wast'), '--asyncify', '-o', 'a.wasm'])
run_process(WASM_DIS + ['a.wasm', '-o', 'a.wast'])
output = run_process(WASM_SHELL + ['a.wast'], capture_output=True).stdout
- with open(self.input_path('asyncify-pure.txt')) as f:
+ with open(self.input_path('asyncify-pure.txt'), 'r') as f:
self.assertEqual(f.read(), output)
def test_asyncify_list_bad(self):
diff --git a/test/unit/test_datacount.py b/test/unit/test_datacount.py
index 5ec98c549..d0d8e9f2b 100644
--- a/test/unit/test_datacount.py
+++ b/test/unit/test_datacount.py
@@ -1,5 +1,5 @@
from scripts.test.shared import WASM_OPT, run_process
-from utils import BinaryenTestCase
+from .utils import BinaryenTestCase
class DataCountTest(BinaryenTestCase):
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index 2a0eca39b..1836aa08a 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -1,6 +1,6 @@
import os
from scripts.test.shared import WASM_OPT, run_process
-from utils import BinaryenTestCase
+from .utils import BinaryenTestCase
class FeatureValidationTest(BinaryenTestCase):
diff --git a/test/unit/test_memory_packing.py b/test/unit/test_memory_packing.py
index a0ccd3006..5d64ccc6c 100644
--- a/test/unit/test_memory_packing.py
+++ b/test/unit/test_memory_packing.py
@@ -1,6 +1,6 @@
import os
from scripts.test.shared import WASM_OPT, run_process
-from utils import BinaryenTestCase
+from .utils import BinaryenTestCase
'''Test that MemoryPacking correctly respects the web limitations by not
generating more than 100K data segments'''
diff --git a/test/unit/test_parsing_error.py b/test/unit/test_parsing_error.py
index 93aab1d16..fde77c6c2 100644
--- a/test/unit/test_parsing_error.py
+++ b/test/unit/test_parsing_error.py
@@ -1,5 +1,5 @@
from scripts.test.shared import WASM_OPT, run_process
-from utils import BinaryenTestCase
+from .utils import BinaryenTestCase
import os
diff --git a/test/unit/test_tail_call_type.py b/test/unit/test_tail_call_type.py
index 4db0589c4..42da89d26 100644
--- a/test/unit/test_tail_call_type.py
+++ b/test/unit/test_tail_call_type.py
@@ -1,5 +1,5 @@
from scripts.test.shared import WASM_OPT, run_process
-from utils import BinaryenTestCase
+from .utils import BinaryenTestCase
import os
diff --git a/test/unit/utils.py b/test/unit/utils.py
index 876f2f4ec..6b18235b5 100644
--- a/test/unit/utils.py
+++ b/test/unit/utils.py
@@ -9,12 +9,11 @@ class BinaryenTestCase(unittest.TestCase):
def roundtrip(self, filename, opts=[]):
path = self.input_path(filename)
- p = run_process(WASM_OPT + ['-g', '-o', '-', path] + opts, check=False,
- capture_output=True)
+ p = run_process(WASM_OPT + ['-g', '-o', 'a.wasm', path] + opts)
self.assertEqual(p.returncode, 0)
- self.assertEqual(p.stderr, '')
with open(path, 'rb') as f:
- self.assertEqual(str(p.stdout), str(f.read()))
+ with open('a.wasm', 'rb') as g:
+ self.assertEqual(g.read(), f.read())
def disassemble(self, filename):
path = self.input_path(filename)
diff --git a/test/wasm2js/comments.2asm.js b/test/wasm2js/comments.2asm.js
index 81100c40c..e31607d1d 100644
--- a/test/wasm2js/comments.2asm.js
+++ b/test/wasm2js/comments.2asm.js
@@ -28,33 +28,3 @@ function asmFunc(global, env, buffer) {
var memasmFunc = new ArrayBuffer(65536);
var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc);
-
-function asmFunc(global, env, buffer) {
- var HEAP8 = new global.Int8Array(buffer);
- var HEAP16 = new global.Int16Array(buffer);
- var HEAP32 = new global.Int32Array(buffer);
- var HEAPU8 = new global.Uint8Array(buffer);
- var HEAPU16 = new global.Uint16Array(buffer);
- var HEAPU32 = new global.Uint32Array(buffer);
- var HEAPF32 = new global.Float32Array(buffer);
- var HEAPF64 = new global.Float64Array(buffer);
- var Math_imul = global.Math.imul;
- var Math_fround = global.Math.fround;
- var Math_abs = global.Math.abs;
- var Math_clz32 = global.Math.clz32;
- var Math_min = global.Math.min;
- var Math_max = global.Math.max;
- var Math_floor = global.Math.floor;
- var Math_ceil = global.Math.ceil;
- var Math_sqrt = global.Math.sqrt;
- var abort = env.abort;
- var nan = global.NaN;
- var infinity = global.Infinity;
- var FUNCTION_TABLE = [];
- return {
-
- };
-}
-
-var memasmFunc = new ArrayBuffer(65536);
-var retasmFunc = asmFunc({Math,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,NaN,Infinity}, {abort:function() { throw new Error('abort'); }},memasmFunc);