Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run tests on CLion #71

Open
gerritsangel opened this issue Jan 31, 2021 · 2 comments
Open

Cannot run tests on CLion #71

gerritsangel opened this issue Jan 31, 2021 · 2 comments

Comments

@gerritsangel
Copy link

I think bootimage has some problems with the custom test runner on CLion/Rust plugin.

CLion can create a Cargo run configuration for tests. This creates the following cargo command:

C:/Programming/Rust/cargo/bin/cargo.exe test --color=always --no-fail-fast -- -Z unstable-options --format=json --show-output

Unfortunately, the arguments after -- are passed to qemu as is

Running: `qemu-system-x86_64 -drive format=raw,file=C:\dev\Workspace\gerrix\target\x86_64-blog_os\debug\deps\bootimage-gerrix-d6bdb98945edd169.bin -no-reboot -device isa-debug-exit,iobase=0xf4,iosize=0x04 -Z unstable-options --format=json --show-output`
qemu-system-x86_64: -Z: invalid option

Running the test via cargo test works, though.

@phil-opp
Copy link
Member

phil-opp commented Feb 2, 2021

It looks like CLion only supports Rust's built-in test runner. I don't think that it would make sense to filter out the --format=json etc arguments in bootimage because the output format would still be incompatible if CLion expects some specific JSON output.

It's probably also worth mentioning that I'm planning to release a new bootloader version that does no longer require bootimage at all and instead lets user define their own small "runner" crates. This should allow you to adjust your runner exactly as you need, including the QEMU arguments.

@avrong
Copy link

avrong commented Sep 24, 2021

Rust plugin uses its test tool window to perform tests. It needs cargo test JSON output to show it there, and adds this flag implicitly on test.

As a workaround, you can make an alias to test command in .cargo/config.toml and avoid Rust plugin to add --format=json to the command. Then, use cargo t in cargo run configuration.

[alias]
t = "test"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants