mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Debug+instrumented `-m test -u all` spent 5.5h on 41 tests. Use --release, a 120s per-test timeout, and -j0. Bound the suite step at 180 minutes so a hang still leaves time to report. Assisted-by: Grok:4.6
32 lines
681 B
Python
32 lines
681 B
Python
import os
|
|
import subprocess
|
|
|
|
TARGET = "extra_tests/snippets"
|
|
|
|
|
|
def run_llvm_cov(file_path: str):
|
|
"""Run cargo llvm-cov on a file."""
|
|
if file_path.endswith(".py"):
|
|
command = [
|
|
"cargo",
|
|
"llvm-cov",
|
|
"--no-report",
|
|
"--release",
|
|
"run",
|
|
"--",
|
|
file_path,
|
|
]
|
|
subprocess.call(command)
|
|
|
|
|
|
def iterate_files(folder: str):
|
|
"""Iterate over all files in a folder."""
|
|
for root, _, files in os.walk(folder):
|
|
for file in files:
|
|
file_path = os.path.join(root, file)
|
|
run_llvm_cov(file_path)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
iterate_files(TARGET)
|