[Lldb-commits] [PATCH] D16741: Make many of the skip decorators use common code
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 1 02:43:37 PST 2016
labath added a comment.
I am confused as to how could this even work, since all your decorators seem to be ignoring the function they are decorating. I'm pretty sure this is going to cause some very weird things to happen things to come out of the decoration process, which might explain your confusion. Try giving it a go by passing the function explicitly.
Comment at: packages/Python/lldbsuite/test/lldbtest.py:560
@@ -559,3 +559,1 @@
"""Decorate the item as a debugserver test."""
- if isinstance(func, type) and issubclass(func, unittest2.TestCase):
- raise Exception("@debugserver_test can only be used to decorate a test method")
Please don't remove these. They make sure that you do not attempt to apply this decorator to a class. If the decorator is not ready for that (and the current skipIfTestFn does not appear to be), it will just cause the whole cause the whole class to be silently ignored (we've had this happen before).
I think it's ok to centralize the check in skipTestIfFn.
Comment at: packages/Python/lldbsuite/test/lldbtest.py:562
@@ -571,1 +561,3 @@
+ return (configuration.dont_do_debugserver_test, "debugserver tests")
+ return skipTestIfFn(should_skip_debugserver_tests)
You have dropped "func" completely here. Should this be `skipTestIfFn(should_skip_debugserver_tests, func)`? (Same goes for other decorators.)
More information about the lldb-commits