Files
VCCPlusOSS/tests/toolchain/orch90/check.py
T

27 lines
1.2 KiB
Python

# SPDX-License-Identifier: GPL-3.0-or-later
"""Measure compiled Orchestra-90 stereo through VCC Plus at both CoCo clock speeds."""
import argparse
from pathlib import Path
import subprocess
import tempfile
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("runtime", type=Path, help="staged Toolchain directory with liborch90.a")
parser.add_argument("core", type=Path, help="current libVCCCore.a")
parser.add_argument("rom", type=Path, help="local 32 KiB CoCo 3 system ROM")
args = parser.parse_args()
fixture = Path(__file__).resolve().parent
with tempfile.TemporaryDirectory(prefix="vcc-orch90-") as work:
subprocess.run([args.runtime.resolve() / "bin/cmoc", "--coco", "-o", "PLAY.BIN",
fixture / "playback.c", "-lorch90"], cwd=work, check=True)
subprocess.run(["xcrun", "clang++", "-std=c++17", "-O2", "-mmacosx-version-min=14.0",
fixture / "measure.cpp", args.core.resolve(), "-o", "measure"], cwd=work, check=True)
subprocess.run(["./measure", args.rom.resolve(), "PLAY.BIN"], cwd=work, check=True)
if __name__ == "__main__":
main()