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

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 5 04:03:12 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL334009: dotest: make inline tests compatible with -f (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D47579

Files:
  lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py


Index: lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
@@ -84,18 +84,6 @@
 class InlineTest(TestBase):
     # Internal implementation
 
-    def getRerunArgs(self):
-        # The -N option says to NOT run a if it matches the option argument, so
-        # if we are using dSYM we say to NOT run dwarf (-N dwarf) and vice
-        # versa.
-        if self.using_dsym is None:
-            # The test was skipped altogether.
-            return ""
-        elif self.using_dsym:
-            return "-N dwarf " + self.mydir
-        else:
-            return "-N dsym " + self.mydir
-
     def BuildMakefile(self):
         makefilePath = self.getBuildArtifact("Makefile")
         if os.path.exists(makefilePath):
@@ -135,37 +123,10 @@
         makefile.flush()
         makefile.close()
 
-    @add_test_categories(["dsym"])
-    def __test_with_dsym(self):
-        self.using_dsym = True
-        self.BuildMakefile()
-        self.build()
-        self.do_test()
-    __test_with_dsym.debug_info = "dsym"
-
-    @add_test_categories(["dwarf"])
-    def __test_with_dwarf(self):
-        self.using_dsym = False
-        self.BuildMakefile()
-        self.build()
-        self.do_test()
-    __test_with_dwarf.debug_info = "dwarf"
-
-    @add_test_categories(["dwo"])
-    def __test_with_dwo(self):
-        self.using_dsym = False
-        self.BuildMakefile()
-        self.build()
-        self.do_test()
-    __test_with_dwo.debug_info = "dwo"
-
-    @add_test_categories(["gmodules"])
-    def __test_with_gmodules(self):
-        self.using_dsym = False
+    def _test(self):
         self.BuildMakefile()
         self.build()
         self.do_test()
-    __test_with_gmodules.debug_info = "gmodules"
 
     def execute_user_command(self, __command):
         exec(__command, globals(), locals())
@@ -237,23 +198,15 @@
     InlineTest.mydir = TestBase.compute_mydir(__file)
 
     test_name, _ = os.path.splitext(file_basename)
-    # Build the test case
-    test = type(test_name, (InlineTest,), {'using_dsym': None})
-    test.name = test_name
 
-    test.test_with_dsym = ApplyDecoratorsToFunction(
-        test._InlineTest__test_with_dsym, decorators)
-    test.test_with_dwarf = ApplyDecoratorsToFunction(
-        test._InlineTest__test_with_dwarf, decorators)
-    test.test_with_dwo = ApplyDecoratorsToFunction(
-        test._InlineTest__test_with_dwo, decorators)
-    test.test_with_gmodules = ApplyDecoratorsToFunction(
-        test._InlineTest__test_with_gmodules, decorators)
+    test_func = ApplyDecoratorsToFunction(InlineTest._test, decorators)
+    # Build the test case
+    test_class = type(test_name, (InlineTest,), dict(test=test_func, name=test_name))
 
     # Add the test case to the globals, and hide InlineTest
-    __globals.update({test_name: test})
+    __globals.update({test_name: test_class})
 
     # Keep track of the original test filename so we report it
     # correctly in test results.
-    test.test_filename = __file
-    return test
+    test_class.test_filename = __file
+    return test_class


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47579.149932.patch
Type: text/x-patch
Size: 3252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180605/e8e67cf0/attachment.bin>


More information about the lldb-commits mailing list