-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[root.exe] Use non-zero exit status when invalid arguments are passed #19196
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
base: master
Are you sure you want to change the base?
Conversation
f8f008e
to
c177567
Compare
@@ -8,34 +8,6 @@ | |||
using testing::internal::CaptureStderr; | |||
using testing::internal::GetCapturedStderr; | |||
|
|||
TEST(TRint, ExitOnUnknownArgs) |
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.
Why is this test removed?
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.
Because I cannot make it pass. Now that TApplication exits with status 2, the end of this test cannot be reached. It will always fail.
It is replaced by
add_test(NAME root_exitStatus COMMAND $<TARGET_FILE:root.exe> "-e invalid")
set_property(TEST root_exitStatus PROPERTY WILL_FAIL TRUE)
which admittedly doesn't test the error message, but it does test that root exits with != 0
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.
LGTM.
Side note: The RUFF does not seem to handle well deleted files, see:
https://github.com/root-project/root/actions/runs/15901873603/job/44846574695?pr=19196
which says:
Run files=$(cat changed_files.txt | grep '\.py$' || echo "")
Error: tutorials/.enableImplicitMTWrapper.py:1:1: E902 No such file or directory (os error 2)
Error: Process completed with exit code 123.
Test Results 20 files 20 suites 3d 12h 53m 49s ⏱️ Results for commit 4720fd7. ♻️ This comment has been updated with latest results. |
@pcanal I had noticed the same, but this problem was fixed in the mean time here: #19197 |
This invocation root.exe "-e EnableImplicitMT(4)" (single argument instead of two) broke the IMT tutorials, but went undetected. Also add test for non-zero exit when invalid arguments are passed.
c177567
to
4720fd7
Compare
Followup to #19195:
RDF IMT tutorials didn't run since 10 months, since the following passed with a 0 exit status:
To avoid similar problem in the future, I suggest here to exit with a non-zero exit status. I chose 2 because 1 usually means that the script/macro/command that was running in the interpreter failed:
Whereas a failure to parse the argument would now be: