Skip to content
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
15 changes: 14 additions & 1 deletion Platforms/emscripten/__main__.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -578,7 +578,10 @@ def run_emscripten_python(context):
if args and args[0] == "--":
args = args[1:]

os.execv(str(exec_script), [str(exec_script)] + args)
if context.test:
args = load_config_toml()["test-args"] + args

os.execv(str(exec_script), [str(exec_script), *args])


def build_target(context):
Expand DownExpand Up@@ -695,6 +698,15 @@ def main():
"run",
help="Run the built emscripten Python",
)
run.add_argument(
"--test",
action="store_true",
default=False,
help=(
"If passed, will add the default test arguments to the beginning of the command. "
"Default arguments loaded from Platforms/emscripten/config.toml"
)
)
run.add_argument(
"args",
nargs=argparse.REMAINDER,
Expand All@@ -704,6 +716,7 @@ def main():
)
)
add_cross_build_dir_option(run)

clean = subcommands.add_parser(
"clean", help="Delete files and directories created by this script"
)
Expand Down
8 changes: 8 additions & 0 deletions Platforms/emscripten/config.toml
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,14 @@
# Python versions.
emscripten-version = "4.0.12"
node-version = "24"
test-args = [
"-m", "test",
"-v",
"-uall",
"--rerun",
"--single-process",
"-W",
]

[libffi]
url = "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz"
Expand Down
Loading