[Lldb-commits] [PATCH] D47579: dotest: make inline tests compatible with -f

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 31 05:40:18 PDT 2018


labath added a comment.

In https://reviews.llvm.org/D47579#1117457, @JDevlieghere wrote:

> If I correctly understand this change, this might make it possible to apply the `add_test_categories` decorator to an inline test. We had issues with this when introducing the swiftpr category because the methods were part of the inline test class. From the description I get the idea that now they become part of the individual instantiations? I **really** hope this is the case :-)


I don't think this will have any affect on that as this still applies the decorators to the base class. However, I have an idea what might solve that.

Can you try inserting something like this instead of the `ApplyDecoratorsToFunction` line and see if your problems go away?

  @wraps(InlineTest._test)
  def test_func(*args, **kwargs):
      return InlineTest._test(*args, **kwargs)
  
  test_func = ApplyDecoratorsToFunction(test_func, decorators)

This should make sure each test class gets a fresh function object with an independent set of categories.



================
Comment at: packages/Python/lldbsuite/test/lldbinline.py:139
+    def _test(self):
         self.using_dsym = True
         self.BuildMakefile()
----------------
JDevlieghere wrote:
> Will the decorators ensure that this value is properly set (or ignored) for the non-dsym tests? 
Ah, good catch. No the decorators won't do that. However, this property is only used in getRerunArgs.
In fact it turns out that after this patch we don't even need to override getRerunArgs for inline tests as the default implementation (which just appends `-f class.method`) will work just fine for inline tests as well (or at least, it won't be any worse).

So I just obliterate every mention of this property.


https://reviews.llvm.org/D47579





More information about the lldb-commits mailing list