test: resolve $MARQDO_BIN placeholder in case args and env

Keeps the process self-test usable for any verified CLI identity without
recording a machine-specific absolute path in the repository.
This commit was merged in pull request #2.
This commit is contained in:
cflmy committed 2026-11-26 23:13:32 +08:00
1 parent e15256300f
commit c2a7d327e5
1 file changed
+3 -2
+3 -2
View File
@@ -80,11 +80,12 @@ def _run_case(case: dict, case_path: Path, binary: str, bundle: Path) -> None:
env = os.environ.copy()
env["MARQDO_STDLIB_DIR"] = str(bundle)
for key, value in case.get("env", {}).items():
env[key] = str(value)
env[key] = str(value).replace("$MARQDO_BIN", binary)
version = subprocess.run(
[binary, "--version"], capture_output=True, text=True, check=True
).stdout
command = [binary, "run", str(source), *case.get("args", []), "--output", "json"]
args = [str(arg).replace("$MARQDO_BIN", binary) for arg in case.get("args", [])]
command = [binary, "run", str(source), *args, "--output", "json"]
result = subprocess.run(
command,
cwd=REPO,