[Lldb-commits] [PATCH] D16615: Refactor some of the skip / xfail decorators to reuse more code.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 26 17:32:13 PST 2016


zturner created this revision.
zturner added reviewers: tfiala, labath.
zturner added a subscriber: lldb-commits.
Herald added subscribers: srhines, danalbert, tberghammer.

This is going to be part of a larger effort to clean up some of these decorators as the code is getting really unwieldy and difficult to understand and maintain.  For now, this patch:

a) Changes the `skipIf` decorator to be called `decorateTest` and gives it a `mode` parameter that says whether we're skipping or xfailing.  This allows the skip and xfail decorators to take the same set of arguments and use the same logic for checking the condition so that we only have 1 large and ugly function instead of 2 large and ugly functions that diverge from each other.

b) Update `expectedFailureAll` and `skipIf` to call `decorateTest`, so that all existing code using those decorators go through the common code path, and so that `skipIf` and `expectedFailureAll` now support the same set of arguments.

c) Change the way the skip / xfail "reason" is computed to be more friendly.

d) Delete this weird code that says `if six.callable(bugnumber)` everywhere since it appears to be an invalid assumption about what a bugnumber is (i.e. always a string, never a callable).

Ran the test suite before and after my CL, and the summary statistics at the end are identical in both cases.

In future patches I intend to:

a) Move all the decorators to another file somewhere so they are all isolated and not lost in a sea of 10,000 lines of other code.

b) Remove some of them and consolidate to using the "master" decorators that can are essentially a superset of some of the existing specialized decorators.

c) Add a command line option that causes the test suite to treat skips as xfails.


http://reviews.llvm.org/D16615

Files:
  packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
  packages/Python/lldbsuite/test/lldbtest.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16615.46085.patch
Type: text/x-patch
Size: 13600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160127/3e4194f2/attachment.bin>


More information about the lldb-commits mailing list