[Lldb-commits] [PATCH] D42836: [dotest] make debug info variant accessible in setUp()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 2 10:13:41 PST 2018


labath added a comment.

In https://reviews.llvm.org/D42836#996288, @aprantl wrote:

> That looks great, to make sure I understand this correctly, is the following accurate?
>
> If we apply this on top of https://reviews.llvm.org/D42763, and we have
>
>   tests/my/testA.py:
>     class TestA(Base):
>       def setUp(self):
>          ...
>       def testAone(self):
>          ...
>       def testAtwo(self):
>          ...
>
>
> and we are testing two variants, "dwo", and "dwarf".
>
> dotest.py will instantiate 4 objects:
>
>   Aone_dwo = new TestA { debug_info="dwo" }
>   Aone_dwarf = new TestA { debug_info="dwo" }
>   Atwo_dwo = new TestA { debug_info="dwo" }
>   Atwo_dwarf = new TestA { debug_info="dwarf" }
>
>
> and schedule
>
>   Aone_dwo.setUp()
>   Aone_dwarf.setUp()
>   Atwo_dwo.setUp()
>   Atwo_dwarf.setUp()
>
>
> and then
>
>   Aone_dwo.testAone()
>   Aone_dwarf.testAone()
>   Atwo_dwo.testAtwo()
>   Atwo_dwarf.testAtwo()
>
>
> Is this accurate, or is there something missing to make it behave this way?


Not completely accurate. The steps are the correct, but the order is different. It will be something like

  for test in ["testAdwarf", "testAdwo", "testBdwarf", "testBdwo"]:
    A = new TestA(test) # initializes A._testMethodName
    A.setUp() # can access debug info variant through A._testMethodName (a.k.a A.testMethodName)
    getattr(A, test)()
    A.tearDown()

I don't know whether this distinction matters for you right now (?)


https://reviews.llvm.org/D42836





More information about the lldb-commits mailing list