summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2015-10-13 18:37:53 -0700
committerBen Smith <binji@chromium.org>2015-10-13 18:37:53 -0700
commit534349a24d7485dd2098ee10df080df53354935d (patch)
treef17073ab3322fcbdc1ddd48865980f68eda7c370
parent4ad13fc40a15f85d95b145c5b84c4e156c6af059 (diff)
downloadwabt-534349a24d7485dd2098ee10df080df53354935d.tar.gz
wabt-534349a24d7485dd2098ee10df080df53354935d.tar.bz2
wabt-534349a24d7485dd2098ee10df080df53354935d.zip
run spec tests that crash
Rather than skipping tests that crash v8, run them but strip the callstack so the output is consistent.
-rwxr-xr-xtest/run-d8.py19
-rwxr-xr-xtest/run-tests.py44
-rw-r--r--test/spec/conversions.txt13
-rw-r--r--test/spec/f32.txt13
-rw-r--r--test/spec/f64.txt13
-rw-r--r--test/spec/float_misc.txt13
-rw-r--r--test/spec/i32.txt13
-rw-r--r--test/spec/i64.txt13
-rw-r--r--test/spec/left-to-right.txt13
-rw-r--r--test/spec/switch.txt2
-rw-r--r--test/spec/traps.txt25
11 files changed, 148 insertions, 33 deletions
diff --git a/test/run-d8.py b/test/run-d8.py
index 13543799..e5fecb0b 100755
--- a/test/run-d8.py
+++ b/test/run-d8.py
@@ -20,6 +20,16 @@ class Error(Exception):
pass
+def StripCallStack(stderr):
+ result = ''
+ for line in stderr.splitlines(1):
+ if line.startswith('==== C stack trace'):
+ return result
+ else:
+ result += line
+ return result
+
+
def main(args):
parser = argparse.ArgumentParser()
parser.add_argument('-e', '--executable', metavar='EXE',
@@ -69,7 +79,14 @@ def main(args):
cmd = [d8, SPEC_JS, generated.name]
else:
cmd = [d8, WASM_JS, '--', generated.name]
- subprocess.check_call(cmd)
+ try:
+ process = subprocess.Popen(cmd, stderr=subprocess.PIPE)
+ _, stderr = process.communicate()
+ if process.returncode != 0:
+ raise Error(StripCallStack(stderr))
+ except OSError as e:
+ raise Error(str(e))
+
finally:
if generated:
generated.close()
diff --git a/test/run-tests.py b/test/run-tests.py
index b36aa183..d0f04806 100755
--- a/test/run-tests.py
+++ b/test/run-tests.py
@@ -99,29 +99,27 @@ class TestInfo(object):
state = 'stdout'
continue
- if state != 'header':
- raise Error('unexpected directive: %s' % line)
-
- key, value = directive.split(':', 1)
- key = key.strip().lower()
- value = value.strip()
- if key in seen_keys:
- raise Error('%s already set' % key)
- seen_keys.add(key)
- if key == 'exe':
- self.exe = value
- elif key == 'stdin_file':
- self.input_file = value
- elif key == 'flags':
- self.flags = shlex.split(value)
- elif key == 'error':
- self.expected_error = int(value)
- elif key == 'slow':
- self.slow = True
- elif key == 'skip':
- self.skip = True
- else:
- raise Error('Unknown directive: %s' % key)
+ if state == 'header':
+ key, value = directive.split(':', 1)
+ key = key.strip().lower()
+ value = value.strip()
+ if key in seen_keys:
+ raise Error('%s already set' % key)
+ seen_keys.add(key)
+ if key == 'exe':
+ self.exe = value
+ elif key == 'stdin_file':
+ self.input_file = value
+ elif key == 'flags':
+ self.flags = shlex.split(value)
+ elif key == 'error':
+ self.expected_error = int(value)
+ elif key == 'slow':
+ self.slow = True
+ elif key == 'skip':
+ self.skip = True
+ else:
+ raise Error('Unknown directive: %s' % key)
elif state == 'header':
state = 'input'
diff --git a/test/spec/conversions.txt b/test/spec/conversions.txt
index 4f46dcdf..5a5552f6 100644
--- a/test/spec/conversions.txt
+++ b/test/spec/conversions.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #162:ExprI64SConvertF32
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/conversions.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #162:ExprI64SConvertF32
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/f32.txt b/test/spec/f32.txt
index 58d9ce96..3f8636a1 100644
--- a/test/spec/f32.txt
+++ b/test/spec/f32.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #121:ExprF32Min
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/f32.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #121:ExprF32Min
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/f64.txt b/test/spec/f64.txt
index 15216883..9509391e 100644
--- a/test/spec/f64.txt
+++ b/test/spec/f64.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #141:ExprF64Min
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/f64.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #141:ExprF64Min
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/float_misc.txt b/test/spec/float_misc.txt
index 89aa7246..32349861 100644
--- a/test/spec/float_misc.txt
+++ b/test/spec/float_misc.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #125:ExprF32CopySign
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/float_misc.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #125:ExprF32CopySign
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/i32.txt b/test/spec/i32.txt
index 437e638e..4d11a3ff 100644
--- a/test/spec/i32.txt
+++ b/test/spec/i32.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #88:ExprI32Ctz
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/i32.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #88:ExprI32Ctz
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/i64.txt b/test/spec/i64.txt
index b25fcaad..dd79c39c 100644
--- a/test/spec/i64.txt
+++ b/test/spec/i64.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #114:ExprI64Clz
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/i64.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #114:ExprI64Clz
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/left-to-right.txt b/test/spec/left-to-right.txt
index 0dc13136..c8f7747c 100644
--- a/test/spec/left-to-right.txt
+++ b/test/spec/left-to-right.txt
@@ -1,4 +1,15 @@
-# SKIP: Unsupported opcode #125:ExprF32CopySign
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/left-to-right.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #125:ExprF32CopySign
+#
+
+
+# STDOUT:
+instantiating module
diff --git a/test/spec/switch.txt b/test/spec/switch.txt
index 4828b068..9e8f72b4 100644
--- a/test/spec/switch.txt
+++ b/test/spec/switch.txt
@@ -1,4 +1,4 @@
# SKIP: switch generation not implemented currently
# EXE: test/run-d8.py
# FLAGS: --spec
-# STDIN_FILE: third_party/spec/ml-proto/test/switch.wase
+# STDIN_FILE: third_party/spec/ml-proto/test/switch.wast
diff --git a/test/spec/traps.txt b/test/spec/traps.txt
index a9467b56..a474c6df 100644
--- a/test/spec/traps.txt
+++ b/test/spec/traps.txt
@@ -1,4 +1,27 @@
-# SKIP: Unsupported opcode #162:ExprI64SConvertF32
+# ERROR: 1
# EXE: test/run-d8.py
# FLAGS: --spec
# STDIN_FILE: third_party/spec/ml-proto/test/traps.wast
+# STDERR:
+
+
+#
+# Fatal error in ../../../../src/wasm/tf-builder.cc, line 199
+# Unsupported opcode #162:ExprI64SConvertF32
+#
+
+
+# STDOUT:
+instantiating module
+$assert_trap_0 failed, didn't throw
+$assert_trap_1 failed, didn't throw
+$assert_trap_2 failed, didn't throw
+$assert_trap_3 failed, didn't throw
+0/4 tests passed.
+instantiating module
+$assert_trap_0 failed, didn't throw
+$assert_trap_1 failed, didn't throw
+$assert_trap_2 failed, didn't throw
+$assert_trap_3 failed, didn't throw
+0/4 tests passed.
+instantiating module