[Lldb-commits] [lldb] r225496 - [InlineTest] getRerunArgs returns an empty string if the test was skipped.

Siva Chandra sivachandra at google.com
Thu Jan 8 17:54:44 PST 2015


Author: sivachandra
Date: Thu Jan  8 19:54:44 2015
New Revision: 225496

URL: http://llvm.org/viewvc/llvm-project?rev=225496&view=rev
Log:
[InlineTest] getRerunArgs returns an empty string if the test was skipped.

Summary:
The main issue that this patch is trying to address is that the current
implementation of getRerunArgs of InlineTest relies on the attribute
'using_dsym' which could be absent if the test was skipped altogether.
[That is, if both dsym and dwarf tests were skipped.]

While at it, the use of deprecated Python module 'new' is eliminated.

Test Plan: [Linux] dotest.py -p TestExprPathSynthetic

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D6888

Modified:
    lldb/trunk/test/lldbinline.py

Modified: lldb/trunk/test/lldbinline.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbinline.py?rev=225496&r1=225495&r2=225496&view=diff
==============================================================================
--- lldb/trunk/test/lldbinline.py (original)
+++ lldb/trunk/test/lldbinline.py Thu Jan  8 19:54:44 2015
@@ -2,7 +2,6 @@ import lldb
 from lldbtest import *
 import lldbutil
 import os
-import new
 import unittest2
 import sys
 
@@ -72,7 +71,10 @@ class InlineTest(TestBase):
     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:
+        if self.using_dsym is None:
+            # The test was skipped altogether.
+            return ""
+        elif self.using_dsym:
             return "-N dwarf %s" % (self.mydir)
         else:
             return "-N dsym %s" % (self.mydir)
@@ -179,7 +181,7 @@ def MakeInlineTest(__file, __globals, de
 
     test_name, _ = os.path.splitext(file_basename)
     # Build the test case 
-    test = new.classobj(test_name, (InlineTest,), {})
+    test = type(test_name, (InlineTest,), {'using_dsym': None})
     test.name = test_name
 
     test.test_with_dsym = ApplyDecoratorsToFunction(test._InlineTest__test_with_dsym, decorators)





More information about the lldb-commits mailing list