bootimage icon indicating copy to clipboard operation
bootimage copied to clipboard

cargo test --quiet passes invalid option --quiet to qemu

Open jasondyoungberg opened this issue 1 year ago • 1 comments

cargo run --quiet works fine, but when I try to run cargo test --quiet, qemu gives the error qemu-system-x86_64: --quiet: invalid option

jasondyoungberg avatar Jan 29 '24 19:01 jasondyoungberg

I believe this occurs due to cargo run consuming the --quiet flag, whereas cargo test --quiet does not consume it, and passes it to the test binary.

See here with a print on the args that bootimage receives with cargo run --quiet:

cargo run --quiet
[src/main.rs:13:5] &raw_args = Args {
    inner: [
        ".../bootimage",
        "runner",
        "target/x86_64-walnut/debug/walnut_os",
    ],
}

and with cargo test --quiet:

cargo test --quiet
[src/main.rs:13:5] &raw_args = Args {
    inner: [
        ".../bootimage",
        "runner",
        "/home/orseti/Source/walnut/walnut_os/target/x86_64-walnut/debug/deps/walnut_os-f71ec98b45354b5e",
        "--quiet",
    ],
}

If you would like to acheive quiet output on all runs and tests, you can do so in your .cargo/config.toml with:

[target.'cfg(target_os = "none")']
runner = "bootimage runner --quiet"

orsetii avatar Feb 14 '24 15:02 orsetii