diff --git a/tests/tests-u-runner/runner/plugins/parser/runner_js_parser.py b/tests/tests-u-runner/runner/plugins/parser/runner_js_parser.py index e43f521c7c0f101dc3d8fc61d5f9cb5a174814d9..a8a0adc31fdbf0490d0ef31bfd857769f59a749f 100644 --- a/tests/tests-u-runner/runner/plugins/parser/runner_js_parser.py +++ b/tests/tests-u-runner/runner/plugins/parser/runner_js_parser.py @@ -26,13 +26,12 @@ class RunnerJSParser(RunnerJS): self.add_directory("parser/as", "ts", flags=["--parse-only", "--extension=as"]) self.add_directory("parser/ets", "ets", flags=[ "--extension=ets", - "--output=/dev/null", + "--opt-level=2", f"--stdlib={self.ets_stdlib_root}", f"--arktsconfig={self.arktsconfig}" ]) self.add_directory("compiler/ets", "ets", flags=[ "--extension=ets", - "--output=/dev/null", f"--stdlib={self.ets_stdlib_root}", f"--arktsconfig={self.arktsconfig}" ]) diff --git a/tests/tests-u-runner/runner/plugins/parser/test_js_parser.py b/tests/tests-u-runner/runner/plugins/parser/test_js_parser.py index d5f2e32d96639920614a4c1068e22f1af69c9a49..048668b42001104a9ba557a878c65396396c65b1 100644 --- a/tests/tests-u-runner/runner/plugins/parser/test_js_parser.py +++ b/tests/tests-u-runner/runner/plugins/parser/test_js_parser.py @@ -1,5 +1,6 @@ import logging -from os import path +from os import path, makedirs +import tempfile from runner.descriptor import Descriptor from runner.utils import write_2_file @@ -12,6 +13,8 @@ class TestJSParser(TestFileBased): def __init__(self, test_env, test_path, flags, test_id): TestFileBased.__init__(self, test_env, test_path, flags, test_id) self.expected_path = f"{path.splitext(self.path)[0]}-expected.txt" + self.bytecode_path = path.join("/tmp", "es2panda") + makedirs(self.bytecode_path, exist_ok=True) def do_run(self): desc = Descriptor(self.path).get_descriptor() @@ -21,11 +24,16 @@ class TestJSParser(TestFileBased): if 'flags' in desc and 'module' in desc['flags']: es2panda_flags.append("--module") - self.passed, self.report, self.fail_kind = self.run_es2panda( - flags=es2panda_flags, - test_abc="", - result_validator=self.es2panda_result_validator - ) + test_basename = path.basename(self.path) + with tempfile.NamedTemporaryFile(mode='w+b', + dir=self.bytecode_path, + prefix=f"{path.splitext(test_basename)[0]}_", + suffix=".abc") as temp_abc: + self.passed, self.report, self.fail_kind = self.run_es2panda( + flags=es2panda_flags, + test_abc=temp_abc.name, + result_validator=self.es2panda_result_validator + ) if self.update_expected and self.report: self.update_expected_files(self.report.output)