<div dir="ltr">Sure, sorry about that</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 14, 2015 at 11:52 AM Tamas Berghammer <<a href="mailto:tberghammer@google.com">tberghammer@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Zachary,<div><br></div><div>This change broke TestLimitDebugInfo with the following error message(copied from the Linux buildbot):</div>======================================================================<div>ERROR: test_limit_debug_info_dwarf (TestWithLimitDebugInfo.TestWithLimitDebugInfo)</div><div>----------------------------------------------------------------------</div><div>Traceback (most recent call last):</div><div>File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2247, in test_method
return attrvalue(self)</div><div>File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1134, in wrapper
if expected_fn(self):</div><div>File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1096, in fn
debug_info_passes = debug_info is None or self.debug_info in debug_info</div><div>TypeError: argument of type 'function' is not iterable
Config=i386-clang-3.5<br><br>Can you take a look?<br><br>Thanks,<br>Tamas</div></div><div dir="ltr"><div><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 14, 2015 at 6:52 PM Zachary Turner via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: zturner<br>
Date: Mon Dec 14 12:49:16 2015<br>
New Revision: 255525<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=255525&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=255525&view=rev</a><br>
Log:<br>
Make debug info specification use categories system.<br>
<br>
Reviewed By: Tamas Berghammer, Pavel Labath<br>
Differential Revision: <a href="http://reviews.llvm.org/D15428" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15428</a><br>
<br>
Modified:<br>
lldb/trunk/packages/Python/lldbsuite/test/configuration.py<br>
lldb/trunk/packages/Python/lldbsuite/test/dotest.py<br>
lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py<br>
lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py<br>
lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py<br>
lldb/trunk/packages/Python/lldbsuite/test/test_categories.py<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Mon Dec 14 12:49:16 2015<br>
@@ -56,10 +56,6 @@ def setupCrashInfoHook():<br>
# The test suite.<br>
suite = unittest2.TestSuite()<br>
<br>
-dont_do_dsym_test = False<br>
-dont_do_dwarf_test = False<br>
-dont_do_dwo_test = False<br>
-<br>
# The list of categories we said we care about<br>
categoriesList = None<br>
# set to true if we are going to use categories for cherry-picking test cases<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Mon Dec 14 12:49:16 2015<br>
@@ -281,14 +281,6 @@ def parseOptionsAndInitTestdirs():<br>
cflags_extras = args.E<br>
os.environ['CFLAGS_EXTRAS'] = cflags_extras<br>
<br>
- # argparse makes sure we have correct options<br>
- if args.N == 'dwarf':<br>
- configuration.dont_do_dwarf_test = True<br>
- elif args.N == 'dwo':<br>
- configuration.dont_do_dwo_test = True<br>
- elif args.N == 'dsym':<br>
- configuration.dont_do_dsym_test = True<br>
-<br>
if args.d:<br>
sys.stdout.write("Suspending the process %d to wait for debugger to attach...\n" % os.getpid())<br>
sys.stdout.flush()<br>
@@ -945,15 +937,6 @@ def run_suite():<br>
<br>
target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]<br>
<br>
- # By default, both dsym, dwarf and dwo tests are performed.<br>
- # Use @dsym_test, @dwarf_test or @dwo_test decorators, defined in lldbtest.py, to mark a test as<br>
- # a dsym, dwarf or dwo test. Use '-N dsym', '-N dwarf' or '-N dwo' to exclude dsym, dwarf or<br>
- # dwo tests from running.<br>
- configuration.dont_do_dsym_test = configuration.dont_do_dsym_test \<br>
- or any(platform in target_platform for platform in ["linux", "freebsd", "windows"])<br>
- configuration.dont_do_dwo_test = configuration.dont_do_dwo_test \<br>
- or any(platform in target_platform for platform in ["darwin", "macosx", "ios"])<br>
-<br>
# Don't do debugserver tests on everything except OS X.<br>
configuration.dont_do_debugserver_test = "linux" in target_platform or "freebsd" in target_platform or "windows" in target_platform<br>
<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Mon Dec 14 12:49:16 2015<br>
@@ -59,7 +59,6 @@ def create_parser():<br>
<br>
# Test filtering options<br>
group = parser.add_argument_group('Test filtering options')<br>
- group.add_argument('-N', choices=['dwarf', 'dwo', 'dsym'], help="Don't do test cases marked with the @dsym_test/@dwarf_test/@dwo_test decorator by passing dsym/dwarf/dwo as the option arg")<br>
group.add_argument('-f', metavar='filterspec', action='append', help='Specify a filter, which consists of the test class name, a dot, followed by the test method, to only admit such test into the test suite') # FIXME: Example?<br>
X('-l', "Don't skip long running tests")<br>
group.add_argument('-p', metavar='pattern', help='Specify a regexp filename pattern for inclusion in the test suite')<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py Mon Dec 14 12:49:16 2015<br>
@@ -117,7 +117,7 @@ for d in test_source_dirs:<br>
# Generate test cases based on the collected source files<br>
for f in test_source_files:<br>
if f.endswith(".cpp") or f.endswith(".c"):<br>
- @dwarf_test<br>
+ @add_test_categories(["dwarf"])<br>
@unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")<br>
def test_function_dwarf(self, f=f):<br>
if f.endswith(".cpp"):<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py Mon Dec 14 12:49:16 2015<br>
@@ -13,20 +13,11 @@ class TypedefTestCase(TestBase):<br>
<br>
mydir = TestBase.compute_mydir(__file__)<br>
<br>
- @skipUnlessDarwin<br>
- @dsym_test<br>
- @expectedFailureClang("<a href="http://llvm.org/pr19238" rel="noreferrer" target="_blank">llvm.org/pr19238</a>")<br>
- def test_with_dsym(self):<br>
+ @expectedFailureAll(bugnumber="<a href="http://llvm.org/pr19238" rel="noreferrer" target="_blank">llvm.org/pr19238</a>", compiler="clang")<br>
+ @expectedFailureAll(bugnumber="<a href="http://llvm.org/pr25626" rel="noreferrer" target="_blank">llvm.org/pr25626</a> expectedFailureClang fails on FreeBSD", oslist=["freebsd"])<br>
+ def test_typedef(self):<br>
"""Test 'image lookup -t a' and check for correct display at different scopes."""<br>
- self.buildDsym()<br>
- self.image_lookup_for_multiple_typedefs()<br>
-<br>
- @dwarf_test<br>
- @expectedFailureClang("<a href="http://llvm.org/pr19238" rel="noreferrer" target="_blank">llvm.org/pr19238</a>")<br>
- @expectedFailureFreeBSD("<a href="http://llvm.org/pr25626" rel="noreferrer" target="_blank">llvm.org/pr25626</a> expectedFailureClang fails on FreeBSD")<br>
- def test_with_dwarf(self):<br>
- """Test 'image lookup -t a' and check for correct display at different scopes."""<br>
- self.buildDwarf()<br>
+ self.build()<br>
self.image_lookup_for_multiple_typedefs()<br>
<br>
def image_lookup_for_multiple_typedefs(self):<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py Mon Dec 14 12:49:16 2015<br>
@@ -6,9 +6,9 @@ class TestWithLimitDebugInfo(TestBase):<br>
<br>
mydir = TestBase.compute_mydir(__file__)<br>
<br>
- @dwarf_test<br>
- def test_with_dwarf(self):<br>
- self.buildDwarf()<br>
+ @skipIf(debug_info=not_in(["dwarf"]))<br>
+ def test_limit_debug_info(self):<br>
+ self.build()<br>
<br>
cwd = os.getcwd()<br>
<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Mon Dec 14 12:49:16 2015<br>
@@ -549,48 +549,6 @@ def no_debug_info_test(func):<br>
wrapper.__no_debug_info_test__ = True<br>
return wrapper<br>
<br>
-def dsym_test(func):<br>
- """Decorate the item as a dsym test."""<br>
- if isinstance(func, type) and issubclass(func, unittest2.TestCase):<br>
- raise Exception("@dsym_test can only be used to decorate a test method")<br>
- @wraps(func)<br>
- def wrapper(self, *args, **kwargs):<br>
- if configuration.dont_do_dsym_test:<br>
- self.skipTest("dsym tests")<br>
- return func(self, *args, **kwargs)<br>
-<br>
- # Mark this function as such to separate them from the regular tests.<br>
- wrapper.__dsym_test__ = True<br>
- return wrapper<br>
-<br>
-def dwarf_test(func):<br>
- """Decorate the item as a dwarf test."""<br>
- if isinstance(func, type) and issubclass(func, unittest2.TestCase):<br>
- raise Exception("@dwarf_test can only be used to decorate a test method")<br>
- @wraps(func)<br>
- def wrapper(self, *args, **kwargs):<br>
- if configuration.dont_do_dwarf_test:<br>
- self.skipTest("dwarf tests")<br>
- return func(self, *args, **kwargs)<br>
-<br>
- # Mark this function as such to separate them from the regular tests.<br>
- wrapper.__dwarf_test__ = True<br>
- return wrapper<br>
-<br>
-def dwo_test(func):<br>
- """Decorate the item as a dwo test."""<br>
- if isinstance(func, type) and issubclass(func, unittest2.TestCase):<br>
- raise Exception("@dwo_test can only be used to decorate a test method")<br>
- @wraps(func)<br>
- def wrapper(self, *args, **kwargs):<br>
- if configuration.dont_do_dwo_test:<br>
- self.skipTest("dwo tests")<br>
- return func(self, *args, **kwargs)<br>
-<br>
- # Mark this function as such to separate them from the regular tests.<br>
- wrapper.__dwo_test__ = True<br>
- return wrapper<br>
-<br>
def debugserver_test(func):<br>
"""Decorate the item as a debugserver test."""<br>
if isinstance(func, type) and issubclass(func, unittest2.TestCase):<br>
@@ -2270,32 +2228,26 @@ class LLDBTestCaseFactory(type):<br>
newattrs = {}<br>
for attrname, attrvalue in attrs.items():<br>
if attrname.startswith("test") and not getattr(attrvalue, "__no_debug_info_test__", False):<br>
- @dsym_test<br>
- @wraps(attrvalue)<br>
- def dsym_test_method(self, attrvalue=attrvalue):<br>
- self.debug_info = "dsym"<br>
- return attrvalue(self)<br>
- dsym_method_name = attrname + "_dsym"<br>
- dsym_test_method.__name__ = dsym_method_name<br>
- newattrs[dsym_method_name] = dsym_test_method<br>
-<br>
- @dwarf_test<br>
- @wraps(attrvalue)<br>
- def dwarf_test_method(self, attrvalue=attrvalue):<br>
- self.debug_info = "dwarf"<br>
- return attrvalue(self)<br>
- dwarf_method_name = attrname + "_dwarf"<br>
- dwarf_test_method.__name__ = dwarf_method_name<br>
- newattrs[dwarf_method_name] = dwarf_test_method<br>
-<br>
- @dwo_test<br>
- @wraps(attrvalue)<br>
- def dwo_test_method(self, attrvalue=attrvalue):<br>
- self.debug_info = "dwo"<br>
- return attrvalue(self)<br>
- dwo_method_name = attrname + "_dwo"<br>
- dwo_test_method.__name__ = dwo_method_name<br>
- newattrs[dwo_method_name] = dwo_test_method<br>
+ target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]<br>
+<br>
+ # If any debug info categories were explicitly tagged, assume that list to be<br>
+ # authoritative. If none were specified, try with all debug info formats.<br>
+ all_dbginfo_categories = set(test_categories.debug_info_categories)<br>
+ categories = set(getattr(attrvalue, "categories", [])) & all_dbginfo_categories<br>
+ if not categories:<br>
+ categories = all_dbginfo_categories<br>
+<br>
+ supported_categories = [x for x in categories<br>
+ if test_categories.is_supported_on_platform(x, target_platform)]<br>
+ for category in supported_categories:<br>
+ @add_test_categories([category])<br>
+ @wraps(attrvalue)<br>
+ def test_method(self, attrvalue=attrvalue):<br>
+ self.debug_info = category<br>
+ return attrvalue(self)<br>
+ method_name = attrname + "_" + category<br>
+ test_method.__name__ = method_name<br>
+ newattrs[method_name] = test_method<br>
else:<br>
newattrs[attrname] = attrvalue<br>
return super(LLDBTestCaseFactory, cls).__new__(cls, name, bases, newattrs)<br>
<br>
Modified: lldb/trunk/packages/Python/lldbsuite/test/test_categories.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=255525&r1=255524&r2=255525&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/test_categories.py?rev=255525&r1=255524&r2=255525&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/packages/Python/lldbsuite/test/test_categories.py (original)<br>
+++ lldb/trunk/packages/Python/lldbsuite/test/test_categories.py Mon Dec 14 12:49:16 2015<br>
@@ -12,8 +12,15 @@ import sys<br>
<br>
# LLDB modules<br>
<br>
+debug_info_categories = [<br>
+ 'dwarf', 'dwo', 'dsym'<br>
+]<br>
+<br>
all_categories = {<br>
'dataformatters': 'Tests related to the type command and the data formatters subsystem',<br>
+ 'dwarf' : 'Tests that can be run with DWARF debug information',<br>
+ 'dwo' : 'Tests that can be run with DWO debug information',<br>
+ 'dsym' : 'Tests that can be run with DSYM debug information',<br>
'expression' : 'Tests related to the expression parser',<br>
'objc' : 'Tests related to the Objective-C programming language support',<br>
'pyapi' : 'Tests related to the Python API',<br>
@@ -35,6 +42,13 @@ def unique_string_match(yourentry, list)<br>
candidate = item<br>
return candidate<br>
<br>
+def is_supported_on_platform(category, platform):<br>
+ if category == "dwo":<br>
+ return platform in ["linux", "freebsd", "windows"]<br>
+ elif category == "dsym":<br>
+ return platform in ["darwin", "macosx", "ios"]<br>
+ return True<br>
+<br>
def validate(categories, exact_match):<br>
"""<br>
For each category in categories, ensure that it's a valid category (if exact_match is false,<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div></div></div></blockquote></div>