Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JIT from test262 runner #5

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def run_streaming_script(
timeout: int,
memory_limit: int,
test_file_paths: list[Path],
jit: bool,
) -> subprocess.CompletedProcess:
def limit_memory():
if platform.system() != "Darwin":
Expand All @@ -105,7 +104,6 @@ def limit_memory():
text=True,
preexec_fn=limit_memory,
errors="ignore", # strip invalid utf8 code points instead of throwing (to allow for invalid utf-8 tests)
env=({"LIBJS_JIT": "1"} if jit else dict()),
)


Expand All @@ -118,7 +116,6 @@ def run_tests(
memory_limit: int,
on_progress_change: Callable[[int, dict[str, int]], None] | None,
forward_stderr: Callable[[str], None] | None,
jit: bool,
) -> list[TestRun]:
current_test = 0
results = []
Expand Down Expand Up @@ -151,7 +148,6 @@ def add_result(
timeout,
memory_limit,
test_file_paths[current_test : current_test + BATCH_SIZE],
jit,
)
except subprocess.CalledProcessError as e:
process_failed = True
Expand Down Expand Up @@ -263,7 +259,6 @@ def __init__(
extra_runner_options: list[str] | None = None,
forward_stderr: bool = False,
summary: bool = False,
jit: bool = False,
) -> None:
self.libjs_test262_runner = libjs_test262_runner
self.test262_root = test262_root
Expand All @@ -282,7 +277,6 @@ def __init__(
self.extra_runner_options = extra_runner_options or []
self.update_function: Callable[[int], None] | None = None
self.print_output: Callable[[Optional[Any]], Any] = print
self.jit = jit

self.forward_stderr_function: Callable[[str], None] | None
if forward_stderr:
Expand Down Expand Up @@ -405,15 +399,14 @@ def process_list(self, files: list[Path]) -> list[TestRun]:
memory_limit=self.memory_limit,
on_progress_change=self.update_function,
forward_stderr=self.forward_stderr_function,
jit=self.jit,
)
except Exception as e:
return [
TestRun(
file,
result=TestResult.RUNNER_EXCEPTION
if i == 0
else TestResult.SKIPPED,
result=(
TestResult.RUNNER_EXCEPTION if i == 0 else TestResult.SKIPPED
),
output=traceback.format_exc() if i == 0 else "",
exit_code=None,
strict_mode=None,
Expand Down Expand Up @@ -506,11 +499,6 @@ def main() -> None:
description="Run the test262 ECMAScript test suite with SerenityOS's LibJS",
epilog=", ".join(f"{EMOJIS[result]} = {result.value}" for result in TestResult),
)
parser.add_argument(
"--jit",
action="store_true",
help="Enable JIT compilation mode",
)
parser.add_argument(
"-j",
"--libjs-test262-runner",
Expand Down Expand Up @@ -623,7 +611,6 @@ def main() -> None:
extra_runner_options,
args.forward_stderr,
args.summary,
args.jit,
)
runner.find_tests(args.pattern, args.ignore)
runner.run()
Expand Down
39 changes: 0 additions & 39 deletions run_all_and_update_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ def main() -> None:
metavar="PATH",
help="output the per-file result to this file",
)
parser.add_argument(
"--per-file-jit-output",
default=None,
type=str,
metavar="PATH",
help="output the per-file JIT result to this file",
)
args = parser.parse_args()

libjs_test262 = Path(__file__).parent
Expand Down Expand Up @@ -168,23 +161,6 @@ def main() -> None:
)
libjs_test262_results = libjs_test262_output["results"]["test"]["results"]

print("Running test262 with JIT compiler...")
libjs_test262_jit_output = json.loads(
# This is not the way, but I can't be bothered to import this stuff. :^)
run_command(
f"python3 {libjs_test262_main_py} "
f"--libjs-test262-runner {libjs_test262_runner} "
f"--test262 {test262} "
"--silent --summary --json --jit "
+ (
""
if args.per_file_jit_output is None
else f"--per-file {args.per_file_jit_output} "
)
)
)
libjs_test262_jit_results = libjs_test262_jit_output["results"]["test"]["results"]

result = {
"commit_timestamp": commit_timestamp,
"run_timestamp": run_timestamp,
Expand All @@ -210,21 +186,6 @@ def main() -> None:
"todo_error": libjs_test262_results["TODO_ERROR"],
},
},
"test262-jit": {
"duration": libjs_test262_jit_output["duration"],
"results": {
"total": libjs_test262_jit_output["results"]["test"]["count"],
"passed": libjs_test262_jit_results["PASSED"],
"failed": libjs_test262_jit_results["FAILED"],
"skipped": libjs_test262_jit_results["SKIPPED"],
"metadata_error": libjs_test262_jit_results["METADATA_ERROR"],
"harness_error": libjs_test262_jit_results["HARNESS_ERROR"],
"timeout_error": libjs_test262_jit_results["TIMEOUT_ERROR"],
"process_error": libjs_test262_jit_results["PROCESS_ERROR"],
"runner_exception": libjs_test262_jit_results["RUNNER_EXCEPTION"],
"todo_error": libjs_test262_jit_results["TODO_ERROR"],
},
},
"test262-parser-tests": {
"duration": test_js_output["duration"],
"results": {
Expand Down
Loading