This is an archive of the discontinued LLVM Phabricator instance.

[debuginfo-tests][dexter] Add _verify_options to TestToolBase
AbandonedPublic

Authored by Pierre-vh on Feb 28 2020, 3:50 AM.

Details

Reviewers
jmorse
Orlando
Summary

This is a minor patch, but it's needed by two other patches (see child revisions), so if one of those two patches is accepted, this should be accepted as well.

This simply adds a feature that allows classes deriving from TestToolBase to stop the execution of the tool early if the options provided are inadequate.

Diff Detail

Event Timeline

Pierre-vh created this revision.Feb 28 2020, 3:50 AM
Pierre-vh created this object with visibility "No One".
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2020, 3:50 AM
Pierre-vh edited the summary of this revision. (Show Details)Feb 28 2020, 4:51 AM
Pierre-vh added reviewers: jmorse, Orlando.
Pierre-vh changed the visibility from "No One" to "Public (No Login Required)".

LGTM except for the inline comment.

debuginfo-tests/dexter/dex/tools/TestToolBase.py
97

Full stop here.

Pierre-vh updated this revision to Diff 247663.Mar 2 2020, 8:48 AM
Pierre-vh marked an inline comment as done.

Adding the full stop as requested

Note that I will not commit this patch unless one of the child diffs are committed and that this change is still needed (because this patch is not useful on its own)

Actually, after looking at how this is being used in the child revisions, it looks like this should be folded into handle_options - that function is already used to check whether the supplied options to a tool are valid, and raises an Error if not. That seems more consistent with the rest of Dexter than returning a ReturnCode.FAIL, which is currently only used if the test is run without any errors but has a failing score.

Actually, after looking at how this is being used in the child revisions, it looks like this should be folded into handle_options

Just to clarify (since I realise this is ambiguous) I think the _verify_options logic in the child revisions should be folded into handle_options, raising Errors instead of returning False, and this revision can be shelved since it's otherwise unnecessary.

Pierre-vh abandoned this revision.Mar 3 2020, 1:12 AM

Revision abandoned as the logic in _verify_options has been folded into handle_options in the child revisions.