rust
rust copied to clipboard
Debugging instructions are missing
Please, consider the possibility to allow debug print during Rst tests.
Hi and welcome to Exercism! :wave:
Thanks for opening an issue :slightly_smiling_face:
- If you are suggesting a new feature or an improvement to Exercism, please take a read of this post, which will likely result in a faster response.
- If you are reporting a bug in the website, thank you! We are getting a lot of reports at the moment (which is great), but we triage and reply as soon as we can.
- If you are requesting support, someone will help shortly.
- For everything else, we will reply or triage your issue to the right repository soon.
This is already possible. I do not remember how to expose this though.
But do you not have this ability when you run your tests locally?
I just use only cloud version. And if I put println!() in my solution, there are no any output in test results
Yes, println() would not be expected to show in the reports for testing.
If getting serious about the language, I do encourage local development though. It gives control back to you, rather than relying on what we provide on the server.
I have sent out a "do you remember how" question in our chat. Hopefully an answer comes soon for you regarding debugging output in the tests.
I found,, that debug output works for structs, which derived Debug trait. So. issue is closed.
Does this need adding to the docs for this? @ErikSchierboom - there's a md doc for this specifically, right?
@iHiD correct, this section is missing for rust because the content is missing

:+1: Reopened and transfering to Rust repo.
Either of the dbg! or eprintln! macros will emit to standard error, which may be captured as debug output; I'd need to double-check the test runner to see what precisely gets captured. If it is in fact captured, then the blurb should mention (and link to documentation for) each of those.
Here are the docs for the file that should contain the debug instructions (provided it does indeed work): https://exercism.org/docs/building/tracks/shared-files#h-file-debug-md
It appears that the test runner sends the debug output to a file called results.out, which I believe to have been meaningful in an older version of the test runner interface.
https://github.com/exercism/rust-test-runner/blob/2e5c4cb7398aa431ccf3bb3cbc4b17fa82e1a41b/bin/run.sh#L41
Until that is updated into the current interface, I suspect that the output simply isn't being captured.
Until recently, both stdout and stderr were captured by the test runner, but they were displayed together as one big string with the error from the failed assertion of the test.
I recently updated the test runner to separate these two, for slightly improved UX. Here's my manual test:
I will update the documentation accordingly.