-
Notifications
You must be signed in to change notification settings - Fork 10
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
New option to print parsed test file with actual stdout, stderr, and exit status #21
Comments
@schoettl no there's no option like this. I agree it would be great if it could optionally update results in test files for you, or at least print out the whole thing as you said. I don't know if the input format is currently stored anywhere. I suspect the first thing to do would be clean up and simplify this messy three format situation somehow. |
@simonmichael thanks for the quick response. I'm looking into it right now.
No, the input format is not stored, at least not in
That would be also great, but I suspect this to be harder to be implemented. Proposed CLI: shelltest --print=v3 example.test
shelltest --print --actual-results example.test
Example use: shelltest --print --actual-results example.test > tmp
vim -d example.test tmp # use a diff tool to update test file I'd love that! :) Oh, but comments would be gone. It may make sense to also parse comments before (and after) all |
Current CLI proposal:
|
Sorry for the delay, I'll respond soon.
|
This is sounding good. I'd be inclined to call --actual --print-with or something, to indicate that it's a modifier for --print and not usable by itself. But, I wonder if we should focus entirely on --print to start with ? It's a nice standalone feature with plenty to discuss. |
Yes, we'll need to preserve comments. |
When you have time, let's review a PR (same one or a new one) that just adds --print. Do we want to support printing v1 and v2 ? Any reason to encourage those ? I don't think so, except for the case where v3's short delimiters clash with your tests. But perhaps just v3 plus the ability to set custom delimiters would be best. |
OK, what do you have in mind?
But here,
To be honest, I'd rather like to integrate it as one thing because the
The problems are:
|
If it's too much work, no problem, I can have a go when I have time. It'll work better for me to tackle this in smaller chunks. |
Already implemented, I think. Especially v1 is easy to generate because it does not support shared input.
As long we support the old input formats for input, I see no problem in also letting shelltest produce the old format. One concrete reason to allow the old formats: I use shelltest on Raspberry Pi in production and it supports only the old format. For this, I had to convert many files from v3 to v1. |
Another reason to support v1/v2: If it comes to generating/updating results, we should not force the user to migrate to v3, if they want to use their current format for any reason. So I'd really like to not discard my efforts in printing different formats. @simonmichael Regarding the
I don't mind – but we should also consider the future |
I think the multiple formats are just an artifact of the design process, they make maintaining and using the tool more complex and actually I'd quite like to kill off the old ones. Your print feature will make this possible. But it doesn't have to happen right now.. The simple |
Hi, I think it would be great to have an option
--print-test-file-with-output
which would print the test file together with the actual output, e.g.:Running:
would yield this output:
Example use:
Or did I miss an option like that?
It would make it easy to generate expected results in new tests. We also could diff and review changes without manually updating parts of the test file.
I could probably implement this. But first a question: Can the program know, after parsing, what the shelltest input format was (v1, v2, v3)? So that it can generate the exact same format?
The text was updated successfully, but these errors were encountered: