aboutsummaryrefslogtreecommitdiff
path: root/test/lang/c
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-12-04 00:32:51 +0000
committerGreg Clayton <gclayton@apple.com>2012-12-04 00:32:51 +0000
commit6475c42148a8ea1ca86e5db465db7eca742d897d (patch)
tree11e27a89e0db31d72adc5b6b5d7aec977253b999 /test/lang/c
parent25b2109486963038a436bdb82fd327a6e5bb8d6d (diff)
downloadlldb-6475c42148a8ea1ca86e5db465db7eca742d897d.tar.gz
<rdar://problem/12798131>
Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite. This fix does the following: - make sure all short options are treated as "int" - make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired - fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates - fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/lang/c')
-rw-r--r--test/lang/c/array_types/TestArrayTypes.py8
-rw-r--r--test/lang/c/bitfields/TestBitfields.py4
-rw-r--r--test/lang/c/forward/TestForwardDeclaration.py2
-rw-r--r--test/lang/c/function_types/TestFunctionTypes.py2
-rw-r--r--test/lang/c/global_variables/TestGlobalVariables.py8
-rw-r--r--test/lang/c/set_values/TestSetValues.py30
6 files changed, 27 insertions, 27 deletions
diff --git a/test/lang/c/array_types/TestArrayTypes.py b/test/lang/c/array_types/TestArrayTypes.py
index 2adb567a7..9e8800366 100644
--- a/test/lang/c/array_types/TestArrayTypes.py
+++ b/test/lang/c/array_types/TestArrayTypes.py
@@ -71,7 +71,7 @@ class ArrayTypesTestCase(TestBase):
# Issue 'variable list' command on several array-type variables.
- self.expect("frame variable -T strings", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types strings", VARIABLES_DISPLAYED_CORRECTLY,
startstr = '(char *[4])',
substrs = ['(char *) [0]',
'(char *) [1]',
@@ -82,14 +82,14 @@ class ArrayTypesTestCase(TestBase):
'Bonjour',
'Guten Tag'])
- self.expect("frame variable -T char_16", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types char_16", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(char) [0]',
'(char) [15]'])
- self.expect("frame variable -T ushort_matrix", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types ushort_matrix", VARIABLES_DISPLAYED_CORRECTLY,
startstr = '(unsigned short [2][3])')
- self.expect("frame variable -T long_6", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types long_6", VARIABLES_DISPLAYED_CORRECTLY,
startstr = '(long [6])')
def array_types_python(self):
diff --git a/test/lang/c/bitfields/TestBitfields.py b/test/lang/c/bitfields/TestBitfields.py
index 177242305..e9bd2ee35 100644
--- a/test/lang/c/bitfields/TestBitfields.py
+++ b/test/lang/c/bitfields/TestBitfields.py
@@ -64,7 +64,7 @@ class BitfieldsTestCase(TestBase):
substrs = [' resolved, hit count = 1'])
# This should display correctly.
- self.expect("frame variable -T bits", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types bits", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(uint32_t:1) b1 = 1',
'(uint32_t:2) b2 = 3',
'(uint32_t:3) b3 = 7',
@@ -76,7 +76,7 @@ class BitfieldsTestCase(TestBase):
# And so should this.
# rdar://problem/8348251
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(uint32_t:1) b1 = 1',
'(uint32_t:2) b2 = 3',
'(uint32_t:3) b3 = 7',
diff --git a/test/lang/c/forward/TestForwardDeclaration.py b/test/lang/c/forward/TestForwardDeclaration.py
index ee37bc073..9ae1fe063 100644
--- a/test/lang/c/forward/TestForwardDeclaration.py
+++ b/test/lang/c/forward/TestForwardDeclaration.py
@@ -48,7 +48,7 @@ class ForwardDeclarationTestCase(TestBase):
# This should display correctly.
# Note that the member fields of a = 1 and b = 2 is by design.
- self.expect("frame variable -T *bar_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types *bar_ptr", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['(bar) *bar_ptr = ',
'(int) a = 1',
'(int) b = 2'])
diff --git a/test/lang/c/function_types/TestFunctionTypes.py b/test/lang/c/function_types/TestFunctionTypes.py
index 009065a0e..5cc6a8b6c 100644
--- a/test/lang/c/function_types/TestFunctionTypes.py
+++ b/test/lang/c/function_types/TestFunctionTypes.py
@@ -66,7 +66,7 @@ class FunctionTypesTestCase(TestBase):
self.runToBreakpoint()
# Check that the 'callback' variable display properly.
- self.expect("frame variable -T callback", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types callback", VARIABLES_DISPLAYED_CORRECTLY,
startstr = '(int (*)(const char *)) callback =')
# And that we can break on the callback function.
diff --git a/test/lang/c/global_variables/TestGlobalVariables.py b/test/lang/c/global_variables/TestGlobalVariables.py
index 27b0a7b25..32a1501f1 100644
--- a/test/lang/c/global_variables/TestGlobalVariables.py
+++ b/test/lang/c/global_variables/TestGlobalVariables.py
@@ -13,13 +13,13 @@ class GlobalVariablesTestCase(TestBase):
@unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@dsym_test
def test_with_dsym(self):
- """Test 'frame variable -s -a' which omits args and shows scopes."""
+ """Test 'frame variable --scope --no-args' which omits args and shows scopes."""
self.buildDsym()
self.global_variables()
@dwarf_test
def test_with_dwarf(self):
- """Test 'frame variable -s -a' which omits args and shows scopes."""
+ """Test 'frame variable --scope --no-args' which omits args and shows scopes."""
self.buildDwarf()
self.global_variables()
@@ -34,7 +34,7 @@ class GlobalVariablesTestCase(TestBase):
self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath))
def global_variables(self):
- """Test 'frame variable -s -a' which omits args and shows scopes."""
+ """Test 'frame variable --scope --no-args' which omits args and shows scopes."""
exe = os.path.join(os.getcwd(), "a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -53,7 +53,7 @@ class GlobalVariablesTestCase(TestBase):
substrs = [' resolved, hit count = 1'])
# Check that GLOBAL scopes are indicated for the variables.
- self.expect("frame variable -T -s -g -a", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types --scope --show-globals --no-args", VARIABLES_DISPLAYED_CORRECTLY,
substrs = ['GLOBAL: (int) g_file_global_int = 42',
'GLOBAL: (const char *) g_file_global_cstr',
'"g_file_global_cstr"',
diff --git a/test/lang/c/set_values/TestSetValues.py b/test/lang/c/set_values/TestSetValues.py
index 1fb6e7b16..5705a04d3 100644
--- a/test/lang/c/set_values/TestSetValues.py
+++ b/test/lang/c/set_values/TestSetValues.py
@@ -61,63 +61,63 @@ class SetValuesTestCase(TestBase):
substrs = [' resolved, hit count = 1'])
# main.c:15
- # Check that 'frame variable -T' displays the correct data type and value.
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ # Check that 'frame variable --show-types' displays the correct data type and value.
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(char) i = 'a'")
# Now set variable 'i' and check that it is correctly displayed.
self.runCmd("expression i = 'b'")
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(char) i = 'b'")
self.runCmd("continue")
# main.c:36
- # Check that 'frame variable -T' displays the correct data type and value.
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ # Check that 'frame variable --show-types' displays the correct data type and value.
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
patterns = ["\((short unsigned int|unsigned short)\) i = 33"])
# Now set variable 'i' and check that it is correctly displayed.
self.runCmd("expression i = 333")
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
patterns = ["\((short unsigned int|unsigned short)\) i = 333"])
self.runCmd("continue")
# main.c:57
- # Check that 'frame variable -T' displays the correct data type and value.
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ # Check that 'frame variable --show-types' displays the correct data type and value.
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(long) i = 33")
# Now set variable 'i' and check that it is correctly displayed.
self.runCmd("expression i = 33333")
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(long) i = 33333")
self.runCmd("continue")
# main.c:78
- # Check that 'frame variable -T' displays the correct data type and value.
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ # Check that 'frame variable --show-types' displays the correct data type and value.
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(double) i = 3.14159")
# Now set variable 'i' and check that it is correctly displayed.
self.runCmd("expression i = 3.14")
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(double) i = 3.14")
self.runCmd("continue")
# main.c:85
- # Check that 'frame variable -T' displays the correct data type and value.
+ # Check that 'frame variable --show-types' displays the correct data type and value.
# rdar://problem/8422727
# set_values test directory: 'frame variable' shows only (long double) i =
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(long double) i = 3.14159")
# Now set variable 'i' and check that it is correctly displayed.
self.runCmd("expression i = 3.1")
- self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+ self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
startstr = "(long double) i = 3.1")