summaryrefslogtreecommitdiff
path: root/test/crash/test_features.py
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-03-19 18:18:20 -0700
committerGitHub <noreply@github.com>2019-03-19 18:18:20 -0700
commitfe0b16aa222318588f3bfd84e549b4a1528be296 (patch)
treee8ae8a1f7cb669809eaec18c7324b795d2a2a530 /test/crash/test_features.py
parent1787295fa5dc81c5eae95df5e847d77e1672a18e (diff)
downloadbinaryen-fe0b16aa222318588f3bfd84e549b4a1528be296.tar.gz
binaryen-fe0b16aa222318588f3bfd84e549b4a1528be296.tar.bz2
binaryen-fe0b16aa222318588f3bfd84e549b4a1528be296.zip
Discover and run unit tests from check.py (#1948)
unittest is Python's standard testing framework, so this change allows arbitrary tests to be written without introducing any new dependencies or code in check.py. A new test that was not possible to write before is also included. It is the first of many.
Diffstat (limited to 'test/crash/test_features.py')
-rw-r--r--test/crash/test_features.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/crash/test_features.py b/test/crash/test_features.py
new file mode 100644
index 000000000..87521d4c0
--- /dev/null
+++ b/test/crash/test_features.py
@@ -0,0 +1,18 @@
+import unittest
+from scripts.test.shared import WASM_OPT, run_process
+
+
+class FeatureValidationTest(unittest.TestCase):
+ def test_simd_type(self):
+ module = """
+ (module
+ (func $foo (param $0 v128) (result v128)
+ (local.get $0)
+ )
+ )
+ """
+ p = run_process(WASM_OPT + ['--mvp-features', '--print'],
+ input=module, check=False, capture_output=True)
+ self.assertIn("all used types should be allowed", p.stderr)
+ self.assertIn("Fatal: error in validating input", p.stderr)
+ self.assertNotEqual(p.returncode, 0)