From fe0b16aa222318588f3bfd84e549b4a1528be296 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Tue, 19 Mar 2019 18:18:20 -0700 Subject: 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. --- test/crash/test_features.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/crash/test_features.py (limited to 'test/crash/test_features.py') 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) -- cgit v1.2.3