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

Run test262 using only the bytecode VM #1

Merged
merged 1 commit into from
Aug 8, 2023
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
14 changes: 0 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class TestRun:
def run_streaming_script(
libjs_test262_runner: Path,
test262_root: Path,
use_bytecode: bool,
extra_runner_options: list[str],
timeout: int,
memory_limit: int,
Expand All @@ -89,7 +88,6 @@ def limit_memory():

command = [
str(libjs_test262_runner),
*(["-b"] if use_bytecode else []),
*extra_runner_options,
"--harness-location",
str((test262_root / "harness").resolve()),
Expand All @@ -113,7 +111,6 @@ def run_tests(
libjs_test262_runner: Path,
test262_root: Path,
test_file_paths: list[Path],
use_bytecode: bool,
extra_runner_options: list[str],
timeout: int,
memory_limit: int,
Expand Down Expand Up @@ -147,7 +144,6 @@ def add_result(
process_result: Any = run_streaming_script(
libjs_test262_runner,
test262_root,
use_bytecode,
extra_runner_options,
timeout,
memory_limit,
Expand Down Expand Up @@ -258,7 +254,6 @@ def __init__(
memory_limit: int,
silent: bool = False,
verbose: bool = False,
use_bytecode: bool = False,
track_per_file: bool = False,
fail_only: bool = False,
extra_runner_options: list[str] | None = None,
Expand All @@ -272,7 +267,6 @@ def __init__(
self.memory_limit = memory_limit
self.silent = silent
self.verbose = verbose
self.use_bytecode = use_bytecode
self.track_per_file = track_per_file
self.fail_only = fail_only
self.files: list[Path] = []
Expand Down Expand Up @@ -400,7 +394,6 @@ def process_list(self, files: list[Path]) -> list[TestRun]:
self.libjs_test262_runner,
self.test262_root,
files,
use_bytecode=self.use_bytecode,
extra_runner_options=self.extra_runner_options,
timeout=self.timeout,
memory_limit=self.memory_limit,
Expand Down Expand Up @@ -513,12 +506,6 @@ def main() -> None:
metavar="PATH",
help="path to the 'test262-runner' binary",
)
parser.add_argument(
"-b",
"--use-bytecode",
action="store_true",
help="Use the bytecode interpreter to run the tests",
)
parser.add_argument(
"-t",
"--test262-root",
Expand Down Expand Up @@ -619,7 +606,6 @@ def main() -> None:
args.memory_limit,
args.silent,
args.verbose,
args.use_bytecode,
args.per_file is not None,
args.fail_only,
extra_runner_options,
Expand Down
45 changes: 3 additions & 42 deletions run_all_and_update_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,7 @@ def main() -> None:
default=None,
type=str,
metavar="PATH",
help="output the per-file result of the non-bytecode run to this file",
)
parser.add_argument(
"--per-file-bytecode-output",
default=None,
type=str,
metavar="PATH",
help="output the per-file result of the bytecode run to this file",
help="output the per-file result to this file",
)
args = parser.parse_args()

Expand Down Expand Up @@ -143,7 +136,7 @@ def main() -> None:
)
test_js_results = test_js_output["results"]["tests"]

print("Running test262 with the AST interpreter...")
print("Running test262...")
libjs_test262_output = json.loads(
# This is not the way, but I can't be bothered to import this stuff. :^)
run_command(
Expand All @@ -160,23 +153,6 @@ def main() -> None:
)
libjs_test262_results = libjs_test262_output["results"]["test"]["results"]

print("Running test262 with the bytecode interpreter...")
libjs_test262_bc_output = json.loads(
# This is not the way either, but I can't be bothered to fix the one above and _then_ copy it. :^)
run_command(
f"python3 {libjs_test262_main_py} "
f"--libjs-test262-runner {libjs_test262_runner} "
f"--test262 {test262} "
"--silent --summary --json --use-bytecode "
+ (
""
if args.per_file_bytecode_output is None
else f"--per-file {args.per_file_bytecode_output} "
)
)
)
libjs_test262_bc_results = libjs_test262_bc_output["results"]["test"]["results"]

result = {
"commit_timestamp": commit_timestamp,
"run_timestamp": run_timestamp,
Expand All @@ -187,7 +163,7 @@ def main() -> None:
"test262-parser-tests": version_test262_parser_tests,
},
"tests": {
"test262": {
"test262-bytecode": {
"duration": libjs_test262_output["duration"],
"results": {
"total": libjs_test262_output["results"]["test"]["count"],
Expand All @@ -202,21 +178,6 @@ def main() -> None:
"todo_error": libjs_test262_results["TODO_ERROR"],
},
},
"test262-bytecode": {
"duration": libjs_test262_bc_output["duration"],
"results": {
"total": libjs_test262_bc_output["results"]["test"]["count"],
"passed": libjs_test262_bc_results["PASSED"],
"failed": libjs_test262_bc_results["FAILED"],
"skipped": libjs_test262_bc_results["SKIPPED"],
"metadata_error": libjs_test262_bc_results["METADATA_ERROR"],
"harness_error": libjs_test262_bc_results["HARNESS_ERROR"],
"timeout_error": libjs_test262_bc_results["TIMEOUT_ERROR"],
"process_error": libjs_test262_bc_results["PROCESS_ERROR"],
"runner_exception": libjs_test262_bc_results["RUNNER_EXCEPTION"],
"todo_error": libjs_test262_bc_results["TODO_ERROR"],
},
},
"test262-parser-tests": {
"duration": test_js_output["duration"],
"results": {
Expand Down
Loading