#!/usr/bin/env python3

from boututils.run_wrapper import build_and_log, launch_safe

build_and_log("unused options test")

for nproc in [1, 2]:
    print(f"Running with nproc={nproc}...", end="")
    s, out = launch_safe(
        "./test_unused_options",
        nproc=nproc,
        mthread=1,
        pipe=True,
    )

    with open(f"run.log.{nproc}", "w") as f:
        f.write(out)

    # Check for printed message
    if "SUCCESS" not in out:
        print("failed")
        exit(1)
    print("pass")
