-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Stdout stream #22
Conversation
There was a problem hiding this 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( |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
I fixed these issues if there's anything else let me know. Thanks for the quick response. |
There was a problem hiding this 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.
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.