diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-11-22 14:46:09 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-22 14:46:09 -0800 |
commit | 66008703800039e9de7cee83ceab1352857d80ea (patch) | |
tree | 9b55128f587d7ea4083ec1c2361a6237e7b36681 /test/unit/test_features.py | |
parent | bf8f36c31c0b8e6213bce840be66937dd6d0f6af (diff) | |
download | binaryen-66008703800039e9de7cee83ceab1352857d80ea.tar.gz binaryen-66008703800039e9de7cee83ceab1352857d80ea.tar.bz2 binaryen-66008703800039e9de7cee83ceab1352857d80ea.zip |
Use package name in imports (NFC) (#2462)
Don't directly import names from shared.py and support.py, and use
prefixes instead. Also this reorders imports based on PEP
recommendation.
Diffstat (limited to 'test/unit/test_features.py')
-rw-r--r-- | test/unit/test_features.py | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py index c031c07fa..dece97ec5 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -1,17 +1,21 @@ import os -from scripts.test.shared import WASM_OPT, run_process -from .utils import BinaryenTestCase +from scripts.test import shared +from . import utils -class FeatureValidationTest(BinaryenTestCase): + +class FeatureValidationTest(utils.BinaryenTestCase): def check_feature(self, module, error, flag): - p = run_process(WASM_OPT + ['--mvp-features', '--print', '-o', os.devnull], - input=module, check=False, capture_output=True) + p = shared.run_process(shared.WASM_OPT + + ['--mvp-features', '--print', '-o', os.devnull], + input=module, check=False, capture_output=True) self.assertIn(error, p.stderr) self.assertIn('Fatal: error in validating input', p.stderr) self.assertNotEqual(p.returncode, 0) - p = run_process(WASM_OPT + ['--mvp-features', flag, '--print', '-o', os.devnull], - input=module, check=False, capture_output=True) + p = shared.run_process(shared.WASM_OPT + + ['--mvp-features', flag, '--print', '-o', + os.devnull], + input=module, check=False, capture_output=True) self.assertEqual(p.returncode, 0) def check_simd(self, module, error): @@ -187,7 +191,7 @@ class FeatureValidationTest(BinaryenTestCase): self.check_exception_handling(module, 'Module has events') -class TargetFeaturesSectionTest(BinaryenTestCase): +class TargetFeaturesSectionTest(utils.BinaryenTestCase): def test_atomics(self): filename = 'atomics_target_feature.wasm' self.roundtrip(filename) @@ -245,8 +249,9 @@ class TargetFeaturesSectionTest(BinaryenTestCase): def test_incompatible_features(self): path = self.input_path('signext_target_feature.wasm') - p = run_process( - WASM_OPT + ['--print', '--enable-simd', '-o', os.devnull, path], + p = shared.run_process( + shared.WASM_OPT + ['--print', '--enable-simd', '-o', os.devnull, + path], check=False, capture_output=True ) self.assertNotEqual(p.returncode, 0) @@ -256,9 +261,9 @@ class TargetFeaturesSectionTest(BinaryenTestCase): def test_incompatible_features_forced(self): path = self.input_path('signext_target_feature.wasm') - p = run_process( - WASM_OPT + ['--print', '--detect-features', '-mvp', '--enable-simd', - '-o', os.devnull, path], + p = shared.run_process( + shared.WASM_OPT + ['--print', '--detect-features', '-mvp', + '--enable-simd', '-o', os.devnull, path], check=False, capture_output=True ) self.assertNotEqual(p.returncode, 0) @@ -269,11 +274,15 @@ class TargetFeaturesSectionTest(BinaryenTestCase): opts=['-mvp', '--detect-features', '--enable-simd']) def test_emit_all_features(self): - p = run_process(WASM_OPT + ['--emit-target-features', '-all', '-o', '-'], - input="(module)", check=False, capture_output=True, decode_output=False) + p = shared.run_process(shared.WASM_OPT + + ['--emit-target-features', '-all', '-o', '-'], + input="(module)", check=False, + capture_output=True, decode_output=False) self.assertEqual(p.returncode, 0) - p2 = run_process(WASM_OPT + ['--print-features', '-o', os.devnull], - input=p.stdout, check=False, capture_output=True) + p2 = shared.run_process(shared.WASM_OPT + + ['--print-features', '-o', os.devnull], + input=p.stdout, check=False, + capture_output=True) self.assertEqual(p2.returncode, 0) self.assertEqual([ '--enable-threads', |