[lldb/Test] Fix substrs order in self.expect for more tests (NFC)

Currently the substrs parameter takes a list of strings that need to be
found but the ordering isn't checked. D73766 might change that so this
changes a several tests so that the order of the strings in the substrs
list is in the order in which they appear in the output.
This commit is contained in:
Jonas Devlieghere 2020-01-31 12:19:03 -08:00
parent 4948b8b3cf
commit f5a71b49be
6 changed files with 35 additions and 21 deletions

View File

@ -53,12 +53,12 @@ class ArrayTypesTestCase(TestBase):
startstr='(char *[4])', startstr='(char *[4])',
substrs=[ substrs=[
'(char *) [0]', '(char *) [0]',
'(char *) [1]',
'(char *) [2]',
'(char *) [3]',
'Hello', 'Hello',
'(char *) [1]',
'Hola', 'Hola',
'(char *) [2]',
'Bonjour', 'Bonjour',
'(char *) [3]',
'Guten Tag']) 'Guten Tag'])
self.expect( self.expect(

View File

@ -38,9 +38,13 @@ class FunctionTypesTestCase(TestBase):
self.runCmd("continue") self.runCmd("continue")
# Check that we do indeed stop on the string_not_empty function. # Check that we do indeed stop on the string_not_empty function.
self.expect("process status", STOPPED_DUE_TO_BREAKPOINT, self.expect(
substrs=['a.out`string_not_empty', "process status",
'stop reason = breakpoint']) STOPPED_DUE_TO_BREAKPOINT,
substrs=[
'stop reason = breakpoint',
'a.out`string_not_empty',
])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
@expectedFailureNetBSD @expectedFailureNetBSD

View File

@ -80,15 +80,16 @@ class GlobalVariablesTestCase(TestBase):
"frame variable --show-types --scope --show-globals --no-args", "frame variable --show-types --scope --show-globals --no-args",
VARIABLES_DISPLAYED_CORRECTLY, VARIABLES_DISPLAYED_CORRECTLY,
substrs=[ substrs=[
'STATIC: (const int) g_file_static_int = 2',
'STATIC: (const char *) g_func_static_cstr', 'STATIC: (const char *) g_func_static_cstr',
'"g_func_static_cstr"',
'GLOBAL: (int *) g_ptr',
'STATIC: (const int) g_file_static_int = 2',
'GLOBAL: (int) g_common_1 = 21',
'GLOBAL: (int) g_file_global_int = 42',
'STATIC: (const char *) g_file_static_cstr',
'"g_file_static_cstr"',
'GLOBAL: (const char *) g_file_global_cstr', 'GLOBAL: (const char *) g_file_global_cstr',
'"g_file_global_cstr"', '"g_file_global_cstr"',
'GLOBAL: (int) g_file_global_int = 42',
'GLOBAL: (int) g_common_1 = 21',
'GLOBAL: (int *) g_ptr',
'STATIC: (const char *) g_file_static_cstr',
'"g_file_static_cstr"'
]) ])
# 'frame variable' should support address-of operator. # 'frame variable' should support address-of operator.

View File

@ -55,8 +55,8 @@ class Char1632TestCase(TestBase):
"frame variable cs16 cs32", "frame variable cs16 cs32",
substrs=[ substrs=[
'(const char16_t *) cs16 = ', '(const char16_t *) cs16 = ',
'(const char32_t *) cs32 = ',
'u"hello world ྒྙྐ"', 'u"hello world ྒྙྐ"',
'(const char32_t *) cs32 = ',
'U"hello world ྒྙྐ"']) 'U"hello world ྒྙྐ"'])
# Check that we correctly report the non-const types # Check that we correctly report the non-const types
@ -64,8 +64,8 @@ class Char1632TestCase(TestBase):
"frame variable s16 s32", "frame variable s16 s32",
substrs=[ substrs=[
'(char16_t *) s16 = ', '(char16_t *) s16 = ',
'(char32_t *) s32 = ',
'u"ﺸﺵۻ"', 'u"ﺸﺵۻ"',
'(char32_t *) s32 = ',
'U"ЕЙРГЖО"']) 'U"ЕЙРГЖО"'])
# Check that we correctly report the array types # Check that we correctly report the array types
@ -92,8 +92,8 @@ class Char1632TestCase(TestBase):
"frame variable s16 s32", "frame variable s16 s32",
substrs=[ substrs=[
'(char16_t *) s16 = 0x', '(char16_t *) s16 = 0x',
'(char32_t *) s32 = ',
'"色ハ匂ヘト散リヌルヲ"', '"色ハ匂ヘト散リヌルヲ"',
'(char32_t *) s32 = ',
'""']) '""'])
# check the same as above for arrays # check the same as above for arrays

View File

@ -45,9 +45,14 @@ class StdCXXDisassembleTestCase(TestBase):
process = target.GetProcess() process = target.GetProcess()
# The process should be in a 'stopped' state. # The process should be in a 'stopped' state.
self.expect(str(process), STOPPED_DUE_TO_BREAKPOINT, exe=False, self.expect(
substrs=["a.out", str(process),
"stopped"]) STOPPED_DUE_TO_BREAKPOINT,
exe=False,
substrs=[
"stopped",
"a.out",
])
# Disassemble the functions on the call stack. # Disassemble the functions on the call stack.
self.runCmd("thread backtrace") self.runCmd("thread backtrace")

View File

@ -37,9 +37,13 @@ class MethodReturningBOOLTestCase(TestBase):
self, "main.m", self.line, num_expected_locations=1, loc_exact=True) self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED) self.runCmd("run", RUN_SUCCEEDED)
self.expect("process status", STOPPED_DUE_TO_BREAKPOINT, self.expect(
substrs=[" at %s:%d" % (self.main_source, self.line), "process status",
"stop reason = breakpoint"]) STOPPED_DUE_TO_BREAKPOINT,
substrs=[
"stop reason = breakpoint",
" at %s:%d" % (self.main_source, self.line),
])
# rdar://problem/9691614 # rdar://problem/9691614
self.runCmd('p (int)[my isValid]') self.runCmd('p (int)[my isValid]')