Index: lldb/packages/Python/lldbsuite/test/lldbinline.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbinline.py +++ lldb/packages/Python/lldbsuite/test/lldbinline.py @@ -206,7 +206,7 @@ test_func = ApplyDecoratorsToFunction(InlineTest._test, decorators) # Build the test case test_class = type(name, (InlineTest,), dict(test=test_func, - name=name, _build_dict=build_dict)) + name=name, __inline_name__=name, _build_dict=build_dict)) # Add the test case to the globals, and hide InlineTest __globals.update({name: test_class}) Index: lldb/packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- lldb/packages/Python/lldbsuite/test/lldbtest.py +++ lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -1743,6 +1743,15 @@ if original_testcase.NO_DEBUG_INFO_TESTCASE: return original_testcase + # Inline tests have one method named 'test' which means that multiple + # inline tests in the same file end up sharing the same build directory + # per variant. The '__inline_name__' attribute ensures that the + # (unique) test name is used instead. + inline_name = None + for attrname, attrvalue in attrs.items(): + if attrname == "__inline_name__": + inline_name = "test_" + attrvalue + newattrs = {} for attrname, attrvalue in attrs.items(): if attrname.startswith("test") and not getattr( @@ -1766,7 +1775,8 @@ def test_method(self, attrvalue=attrvalue): return attrvalue(self) - method_name = attrname + "_" + cat + test_name = inline_name if inline_name else attrname + method_name = test_name + "_" + cat test_method.__name__ = method_name test_method.debug_info = cat newattrs[method_name] = test_method