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

Stdout stream #22

Merged
merged 5 commits into from
Jul 30, 2019
Merged

Stdout stream #22

merged 5 commits into from
Jul 30, 2019

Conversation

DevinR528
Copy link
Contributor

I added a field to the Variations struct to hold stdout from the build command, this seemed preferable to adding another argument to check_pass and check_compile_fail. I print the build output first then print stdout/err as before. The stdout.rs test depends on the derive_mac crate all this could be removed as I just used it to make sure printing to stdout was working.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -209,7 +210,7 @@ impl Test {
Expected::CompileFail => Test::check_compile_fail,
};

check(self, project, name, success, stderr)
check(self, project, name, success, stdio)
}

fn check_pass(
Copy link
Owner

Choose a reason for hiding this comment

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

I would expect check_compile_fail to print the stdout also if there was any.


[dependencies]
syn = "0.15"
quote = "0.6"
Copy link
Owner

Choose a reason for hiding this comment

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

Please make sure every line ends with a newline. Without that, this isn't considered a text file and it messes up line-oriented tools. You should set your editor to always do this.

src/message.rs Outdated
@@ -132,8 +132,9 @@ pub(crate) fn mismatch(expected: &str, actual: &str) {
println!();
}

pub(crate) fn output(warnings: &str, output: &Output) {
pub(crate) fn output(warnings: &str, output: &Output, build_out: &str) {
Copy link
Owner

Choose a reason for hiding this comment

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

I would prefer that the caller concatenate the build output and run output and pass only one Output, so these are printed together under one STDOUT heading. It will be sufficiently clear which parts come from the build and which parts from the compiled code, and this matches what the author would see from cargo run.

test all possible cases


removed examples folder, only used to expand macro while developing
@DevinR528
Copy link
Contributor Author

I fixed these issues if there's anything else let me know. Thanks for the quick response.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Looks good, nicely done.

@dtolnay dtolnay merged commit 2ad0dfe into dtolnay:master Jul 30, 2019
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

Successfully merging this pull request may close these issues.

2 participants