Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 1 | """ |
| 2 | Test that variable expressions of integer basic types are evaluated correctly. |
| 3 | """ |
| 4 | |
| 5 | import AbstractBase |
| 6 | import unittest2 |
| 7 | import lldb |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 8 | import sys |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 9 | |
Johnny Chen | 573335b | 2010-11-09 18:49:57 +0000 | [diff] [blame] | 10 | class IntegerTypesExprTestCase(AbstractBase.GenericTester): |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 11 | |
| 12 | mydir = "types" |
| 13 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 14 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 15 | def test_char_type_with_dsym(self): |
| 16 | """Test that char-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 17 | self.build_and_run_expr('char.cpp', set(['char']), qd=True) |
| 18 | |
| 19 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 20 | def test_char_type_from_block_with_dsym(self): |
| 21 | """Test that char-type variables are displayed correctly from a block.""" |
| 22 | self.build_and_run_expr('char.cpp', set(['char']), bc=True, qd=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 23 | |
| 24 | def test_char_type_with_dwarf(self): |
| 25 | """Test that char-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 26 | self.build_and_run_expr('char.cpp', set(['char']), dsym=False, qd=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 27 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 28 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 29 | def test_unsigned_char_type_with_dsym(self): |
| 30 | """Test that 'unsigned_char'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 31 | self.build_and_run_expr('unsigned_char.cpp', set(['unsigned', 'char']), qd=True) |
| 32 | |
| 33 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 34 | def test_unsigned_char_type_from_block_with_dsym(self): |
| 35 | """Test that 'unsigned char'-type variables are displayed correctly from a block.""" |
| 36 | self.build_and_run_expr('unsigned_char.cpp', set(['unsigned', 'char']), bc=True, qd=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 37 | |
| 38 | def test_unsigned_char_type_with_dwarf(self): |
| 39 | """Test that 'unsigned char'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 40 | self.build_and_run_expr('unsigned_char.cpp', set(['unsigned', 'char']), dsym=False, qd=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 41 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 42 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 43 | def test_short_type_with_dsym(self): |
| 44 | """Test that short-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 45 | self.build_and_run_expr('short.cpp', set(['short'])) |
| 46 | |
| 47 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 48 | def test_short_type_from_block_with_dsym(self): |
| 49 | """Test that short-type variables are displayed correctly from a block.""" |
| 50 | self.build_and_run_expr('short.cpp', set(['short']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 51 | |
| 52 | def test_short_type_with_dwarf(self): |
| 53 | """Test that short-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 54 | self.build_and_run_expr('short.cpp', set(['short']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 55 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 56 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 57 | def test_unsigned_short_type_with_dsym(self): |
| 58 | """Test that 'unsigned_short'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 59 | self.build_and_run_expr('unsigned_short.cpp', set(['unsigned', 'short'])) |
| 60 | |
| 61 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 62 | def test_unsigned_short_type_from_block_with_dsym(self): |
| 63 | """Test that 'unsigned short'-type variables are displayed correctly from a block.""" |
| 64 | self.build_and_run_expr('unsigned_short.cpp', set(['unsigned', 'short']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 65 | |
| 66 | def test_unsigned_short_type_with_dwarf(self): |
| 67 | """Test that 'unsigned short'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 68 | self.build_and_run_expr('unsigned_short.cpp', set(['unsigned', 'short']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 69 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 70 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 71 | def test_int_type_with_dsym(self): |
| 72 | """Test that int-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 73 | self.build_and_run_expr('int.cpp', set(['int'])) |
| 74 | |
| 75 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 76 | def test_int_type_from_block_with_dsym(self): |
| 77 | """Test that int-type variables are displayed correctly from a block.""" |
| 78 | self.build_and_run_expr('int.cpp', set(['int']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 79 | |
| 80 | def test_int_type_with_dwarf(self): |
| 81 | """Test that int-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 82 | self.build_and_run_expr('int.cpp', set(['int']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 83 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 84 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 85 | def test_unsigned_int_type_with_dsym(self): |
| 86 | """Test that 'unsigned_int'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 87 | self.build_and_run_expr('unsigned_int.cpp', set(['unsigned', 'int'])) |
| 88 | |
| 89 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 90 | def test_unsigned_int_type_from_block_with_dsym(self): |
| 91 | """Test that 'unsigned int'-type variables are displayed correctly from a block.""" |
| 92 | self.build_and_run_expr('unsigned_int.cpp', set(['unsigned', 'int']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 93 | |
| 94 | def test_unsigned_int_type_with_dwarf(self): |
| 95 | """Test that 'unsigned int'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 96 | self.build_and_run_expr('unsigned_int.cpp', set(['unsigned', 'int']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 97 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 98 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 99 | def test_long_type_with_dsym(self): |
| 100 | """Test that long-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 101 | self.build_and_run_expr('long.cpp', set(['long'])) |
| 102 | |
| 103 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 104 | def test_long_type_from_block_with_dsym(self): |
| 105 | """Test that long-type variables are displayed correctly from a block.""" |
| 106 | self.build_and_run_expr('long.cpp', set(['long']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 107 | |
| 108 | def test_long_type_with_dwarf(self): |
| 109 | """Test that long-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 110 | self.build_and_run_expr('long.cpp', set(['long']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 111 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 112 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 113 | def test_unsigned_long_type_with_dsym(self): |
| 114 | """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 115 | self.build_and_run_expr('unsigned_long.cpp', set(['unsigned', 'long'])) |
| 116 | |
| 117 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 118 | def test_unsigned_long_type_from_block_with_dsym(self): |
| 119 | """Test that 'unsigned_long'-type variables are displayed correctly from a block.""" |
| 120 | self.build_and_run_expr('unsigned_long.cpp', set(['unsigned', 'long']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 121 | |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 122 | def test_unsigned_long_type_with_dwarf(self): |
| 123 | """Test that 'unsigned long'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 124 | self.build_and_run_expr('unsigned_long.cpp', set(['unsigned', 'long']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 125 | |
| 126 | # rdar://problem/8482903 |
| 127 | # test suite failure for types dir -- "long long" and "unsigned long long" |
| 128 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 129 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 130 | def test_long_long_type_with_dsym(self): |
| 131 | """Test that 'long long'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 132 | self.build_and_run_expr('long_long.cpp', set(['long long'])) |
| 133 | |
| 134 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 135 | def test_long_long_type_from_block_with_dsym(self): |
| 136 | """Test that 'long_long'-type variables are displayed correctly from a block.""" |
| 137 | self.build_and_run_expr('long_long.cpp', set(['long long']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 138 | |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 139 | def test_long_long_type_with_dwarf(self): |
| 140 | """Test that 'long long'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 141 | self.build_and_run_expr('long_long.cpp', set(['long long']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 142 | |
Johnny Chen | 1aabaac | 2010-10-21 21:58:02 +0000 | [diff] [blame] | 143 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 144 | def test_unsigned_long_long_type_with_dsym(self): |
| 145 | """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 146 | self.build_and_run_expr('unsigned_long_long.cpp', set(['unsigned', 'long long'])) |
| 147 | |
| 148 | @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin") |
| 149 | def test_unsigned_long_long_type_from_block_with_dsym(self): |
| 150 | """Test that 'unsigned_long_long'-type variables are displayed correctly from a block.""" |
| 151 | self.build_and_run_expr('unsigned_long_long.cpp', set(['unsigned', 'long long']), bc=True) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 152 | |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 153 | def test_unsigned_long_long_type_with_dwarf(self): |
| 154 | """Test that 'unsigned long long'-type variable expressions are evaluated correctly.""" |
Johnny Chen | 8563081 | 2012-01-10 02:04:04 +0000 | [diff] [blame^] | 155 | self.build_and_run_expr('unsigned_long_long.cpp', set(['unsigned', 'long long']), dsym=False) |
Johnny Chen | b6c15f5 | 2010-09-28 21:03:58 +0000 | [diff] [blame] | 156 | |
| 157 | |
| 158 | if __name__ == '__main__': |
| 159 | import atexit |
| 160 | lldb.SBDebugger.Initialize() |
| 161 | atexit.register(lambda: lldb.SBDebugger.Terminate()) |
| 162 | unittest2.main() |