Skip to content
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

tools: expose skip output to test runner #2130

Closed
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ def HasRun(self, output):
logger.info('#' + l)
for l in output.output.stdout.splitlines():
logger.info('#' + l)
elif output.HasSkipped():
skip = re.findall('# SKIP\S+ (.+)', output.output.stdout,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to use raw strings for RegEx. Also, we can precompile and store the RegEx with re.compile

re.IGNORECASE)
logger.info('ok %i - %s # skip %s' % (self._done, command, skip[0]))
else:
logger.info('ok %i - %s' % (self._done, command))

Expand Down Expand Up @@ -471,6 +475,11 @@ def UnexpectedOutput(self):
outcome = PASS
return not outcome in self.test.outcomes

def HasSkipped(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: It is not pythonic to have a method name starting with a capital letter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the conventions already established in test.py. Wasn't very keen on rewriting them all?

skip = re.search('# SKIP\S+ (.+)', self.output.stdout,
re.IGNORECASE)
return self.store_unexpected_output and skip

def HasPreciousOutput(self):
return self.UnexpectedOutput() and self.store_unexpected_output

Expand Down