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

RUN: enable --show-output when executing tests #4139

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

emmericp
Copy link
Contributor

@emmericp emmericp commented Jul 12, 2019

Fixes #3994

This requires this patch for rust (hopefully in 1.38?): rust-lang/rust#62600

This is work in progress because it doesn't work yet, I'm looking for some help here:
The problem is you can't run rustVersion() in the UI thread and I'd really like to have this behavior as default if the compiler is new enough.
What's the best way to achieve this? Fallback would be to make this an option for the run configuration, but that would be a little bit annoying since virtually everyone would want to enable this?

Edit: changed the code to hardcode 1.38 as Rust version passed to patchArgs because I'm using this branch ;) Looking for a good way to get the Rust version here.

@mchernyavsky mchernyavsky self-assigned this Jul 13, 2019
@emmericp emmericp force-pushed the tests-always-show-stdout branch 2 times, most recently from 5e4d090 to bc1d021 Compare July 13, 2019 21:28
Show output of successful tests when running on a rust version that
supports doing so (1.39.0+)
@emmericp
Copy link
Contributor Author

The feature has been merged and is available in Rust 1.39 nightly builds with a build date of 28-08-2019 or later. I've updated this PR accordingly and fixed the merge conflict

@emmericp emmericp changed the title [WIP] RUN: enable --show-output when executing tests RUN: enable --show-output when executing tests Aug 29, 2019
@mchernyavsky mchernyavsky added this to the v105 milestone Aug 30, 2019
Copy link
Member

@mchernyavsky mchernyavsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bors+


private fun checkShowOutputSupport(ver: RustcVersion?): Boolean {
if (ver == null) return false
// --show-output is supported since 1.39.0-nightly/dev with a build date later than 2019-08-27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check that this flag is supported without version checking? Like we do with some other flags

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no. The --show-output is only mentioned in cargo test -- --help output, but this command may trigger compilation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think it's possible to detect this without compiling tests as it's a feature in libtest that's only in the resulting test binary

@mchernyavsky
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Aug 30, 2019
4139: RUN: enable --show-output when executing tests r=mchernyavsky a=emmericp

Fixes #3994

This requires this patch for rust (hopefully in 1.38?): rust-lang/rust#62600

This is work in progress because it doesn't work yet, I'm looking for some help here:
The problem is you can't run `rustVersion()` in the UI thread and I'd really like to have this behavior as default if the compiler is new enough.
What's the best way to achieve this? Fallback would be to make this an option for the run configuration, but that would be a little bit annoying since virtually everyone would want to enable this?


Edit: changed the code to hardcode 1.38 as Rust version passed to `patchArgs` because I'm using this branch ;) Looking for a good way to get the Rust version here.

<!--
Hello and thank you for the pull request!

We don't have any strict rules about pull requests, but you might check
https://github.com/intellij-rust/intellij-rust/blob/master/CONTRIBUTING.md
for some hints!

Note that we need an electronic CLA for contributions:
https://github.com/intellij-rust/intellij-rust/blob/master/CONTRIBUTING.md#cla

After you sign the CLA, please add your name to
https://github.com/intellij-rust/intellij-rust/blob/master/CONTRIBUTORS.txt

:)
-->


Co-authored-by: Paul Emmerich <paul.emmerich@croit.io>
@bors
Copy link
Contributor

bors bot commented Aug 30, 2019

@bors bors bot merged commit 50cc65d into intellij-rust:master Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option to show stderr/stdout in test toolwindow always
3 participants