Skip to content

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

Open

Description

@jasondyoungberg

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

Activity

  1. tom-h-f commented on Feb 14, 2024

    @tom-h-f

    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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions