def MakeInlineTest(__file, __globals, decorators=None): # Adjust the filename if it ends in .pyc. We want filenames to # reflect the source python file, not the compiled variant. if __file is not None and __file.endswith(".pyc"): # Strip the trailing "c" __file = __file[0:-1] # Derive the test name from the current file name file_basename = os.path.basename(__file) 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 target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] if test_categories.is_supported_on_platform("dsym", target_platform, configuration.compilers): test.test_with_dsym = ApplyDecoratorsToFunction(test._InlineTest__test_with_dsym, decorators) if test_categories.is_supported_on_platform("dwarf", target_platform, configuration.compilers): test.test_with_dwarf = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwarf, decorators) if test_categories.is_supported_on_platform("dwo", target_platform, configuration.compilers): test.test_with_dwo = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwo, decorators) if test_categories.is_supported_on_platform("gmodules", target_platform, configuration.compilers): test.test_with_gmodules = ApplyDecoratorsToFunction(test._InlineTest__test_with_gmodules, decorators) # Add the test case to the globals, and hide InlineTest __globals.update({test_name : test}) # Keep track of the original test filename so we report it # correctly in test results. test.test_filename = __file return test
def MakeREPLTest(__file, __globals, decorators=None): # Adjust the filename if it ends in .pyc. We want filenames to # reflect the source python file, not the compiled variant. if __file is not None and __file.endswith(".pyc"): # Strip the trailing "c" __file = __file[0:-1] # Derive the test name from the current file name file_basename = os.path.basename(__file) REPLTest.mydir = TestBase.compute_mydir(__file) test_name, _ = os.path.splitext(file_basename) # Build the test case test = type(test_name, (REPLTest,), {'using_dsym': None}) test.name = test_name target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] if test_categories.is_supported_on_platform( "dwarf", target_platform, configuration.compiler): test.test_with_dwarf = ApplyDecoratorsToFunction( test._REPLTest__test_with_dwarf, decorators) # Add the test case to the globals, and hide REPLTest __globals.update({test_name: test}) # Keep track of the original test filename so we report it # correctly in test results. test.test_filename = __file return test
def MakeInlineTest(__file, __globals, decorators=None): # Derive the test name from the current file name file_basename = os.path.basename(__file) 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 target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] supported_categories = [x for x in set(test_categories.debug_info_categories) if test_categories.is_supported_on_platform(x, target_platform)] if "dsym" in supported_categories: test.test_with_dsym = ApplyDecoratorsToFunction(test._InlineTest__test_with_dsym, decorators) if "dwarf" in supported_categories: test.test_with_dwarf = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwarf, decorators) if "dwo" in supported_categories: test.test_with_dwo = ApplyDecoratorsToFunction(test._InlineTest__test_with_dwo, decorators) # Add the test case to the globals, and hide InlineTest __globals.update({test_name : test}) # Store the name of the originating file.o test.test_filename = __file return test
def MakeInlineTest(__file, __globals, decorators=None): # Derive the test name from the current file name file_basename = os.path.basename(__file) 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 target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] supported_categories = [ x for x in set(test_categories.debug_info_categories) if test_categories.is_supported_on_platform(x, target_platform) ] if "dsym" in supported_categories: test.test_with_dsym = ApplyDecoratorsToFunction( test._InlineTest__test_with_dsym, decorators) if "dwarf" in supported_categories: test.test_with_dwarf = ApplyDecoratorsToFunction( test._InlineTest__test_with_dwarf, decorators) if "dwo" in supported_categories: test.test_with_dwo = ApplyDecoratorsToFunction( test._InlineTest__test_with_dwo, decorators) # Add the test case to the globals, and hide InlineTest __globals.update({test_name: test}) # Store the name of the originating file.o test.test_filename = __file return test