diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/packages/Python/lldbsuite/test/lang/cpp/stl | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/stl')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py | 49 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py | 24 |
2 files changed, 45 insertions, 28 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py index e2582085702..ce5869742f4 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py @@ -5,14 +5,15 @@ Test some expressions involving STL data types. from __future__ import print_function - import unittest2 -import os, time +import os +import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class STLTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -22,7 +23,8 @@ class STLTestCase(TestBase): TestBase.setUp(self) # Find the line number to break inside main(). self.source = 'main.cpp' - self.line = line_number(self.source, '// Set break point at this line.') + self.line = line_number( + self.source, '// Set break point at this line.') @expectedFailureAll(bugnumber="rdar://problem/10400981") def test(self): @@ -32,42 +34,46 @@ class STLTestCase(TestBase): # The following two lines, if uncommented, will enable loggings. #self.ci.HandleCommand("log enable -f /tmp/lldb.log lldb default", res) - #self.assertTrue(res.Succeeded()) + # self.assertTrue(res.Succeeded()) self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) # rdar://problem/8543077 # test/stl: clang built binaries results in the breakpoint locations = 3, # is this a problem with clang generated debug info? - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) # Stop at 'std::string hello_world ("Hello World!");'. self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, - substrs = ['main.cpp:%d' % self.line, - 'stop reason = breakpoint']) + substrs=['main.cpp:%d' % self.line, + 'stop reason = breakpoint']) # The breakpoint should have a hit count of 1. self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE, - substrs = [' resolved, hit count = 1']) + substrs=[' resolved, hit count = 1']) # Now try some expressions.... - self.runCmd('expr for (int i = 0; i < hello_world.length(); ++i) { (void)printf("%c\\n", hello_world[i]); }') + self.runCmd( + 'expr for (int i = 0; i < hello_world.length(); ++i) { (void)printf("%c\\n", hello_world[i]); }') # rdar://problem/10373783 # rdar://problem/10400981 self.expect('expr associative_array.size()', - substrs = [' = 3']) + substrs=[' = 3']) self.expect('expr associative_array.count(hello_world)', - substrs = [' = 1']) + substrs=[' = 1']) self.expect('expr associative_array[hello_world]', - substrs = [' = 1']) + substrs=[' = 1']) self.expect('expr associative_array["hello"]', - substrs = [' = 2']) + substrs=[' = 2']) - @expectedFailureAll(compiler="icc", bugnumber="ICC (13.1, 14-beta) do not emit DW_TAG_template_type_parameter.") + @expectedFailureAll( + compiler="icc", + bugnumber="ICC (13.1, 14-beta) do not emit DW_TAG_template_type_parameter.") @add_test_categories(['pyapi']) def test_SBType_template_aspects(self): """Test APIs for getting template arguments from an SBType.""" @@ -83,13 +89,17 @@ class STLTestCase(TestBase): self.assertTrue(breakpoint, VALID_BREAKPOINT) # Now launch the process, and do not stop at entry point. - process = target.LaunchSimple (None, None, self.get_process_working_directory()) + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) # Get Frame #0. self.assertTrue(process.GetState() == lldb.eStateStopped) - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) - self.assertTrue(thread.IsValid(), "There should be a thread stopped due to breakpoint condition") + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) + self.assertTrue( + thread.IsValid(), + "There should be a thread stopped due to breakpoint condition") frame0 = thread.GetFrameAtIndex(0) # Get the type for variable 'associative_array'. @@ -102,8 +112,9 @@ class STLTestCase(TestBase): num_template_args = map_type.GetNumberOfTemplateArguments() self.assertTrue(num_template_args > 0) - # We expect the template arguments to contain at least 'string' and 'int'. - expected_types = { 'string': False, 'int': False } + # We expect the template arguments to contain at least 'string' and + # 'int'. + expected_types = {'string': False, 'int': False} for i in range(num_template_args): t = map_type.GetTemplateArgumentType(i) self.DebugSBType(t) diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py index 865516de4ed..47fdf59a27e 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py @@ -5,13 +5,14 @@ Test the lldb disassemble command on lib stdc++. from __future__ import print_function - import unittest2 -import os, time +import os +import time import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil + class StdCXXDisassembleTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -24,7 +25,9 @@ class StdCXXDisassembleTestCase(TestBase): # rdar://problem/8504895 # Crash while doing 'disassemble -n "-[NSNumber descriptionWithLocale:]" - @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test") + @unittest2.skipIf( + TestBase.skipLongRunningTest(), + "Skip this long running test") def test_stdcxx_disasm(self): """Do 'disassemble' on each and every 'Code' symbol entry from the std c++ lib.""" self.build() @@ -36,7 +39,8 @@ class StdCXXDisassembleTestCase(TestBase): # is this a problem with clang generated debug info? # # Break on line 13 of main.cpp. - lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) + lldbutil.run_break_set_by_file_and_line( + self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True) self.runCmd("run", RUN_SUCCEEDED) @@ -46,12 +50,13 @@ class StdCXXDisassembleTestCase(TestBase): # The process should be in a 'stopped' state. self.expect(str(process), STOPPED_DUE_TO_BREAKPOINT, exe=False, - substrs = ["a.out", - "stopped"]) + substrs=["a.out", + "stopped"]) # Disassemble the functions on the call stack. self.runCmd("thread backtrace") - thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + thread = lldbutil.get_stopped_thread( + process, lldb.eStopReasonBreakpoint) self.assertIsNotNone(thread) depth = thread.GetNumFrames() for i in range(depth - 1): @@ -65,7 +70,8 @@ class StdCXXDisassembleTestCase(TestBase): for i in range(target.GetNumModules()): module = target.GetModuleAtIndex(i) fs = module.GetFileSpec() - if (fs.GetFilename().startswith("libstdc++") or fs.GetFilename().startswith("libc++")): + if (fs.GetFilename().startswith("libstdc++") + or fs.GetFilename().startswith("libc++")): lib_stdcxx = str(fs) break @@ -73,7 +79,7 @@ class StdCXXDisassembleTestCase(TestBase): # module is the corresponding SBModule. self.expect(lib_stdcxx, "Libraray StdC++ is located", exe=False, - substrs = ["lib"]) + substrs=["lib"]) self.runCmd("image dump symtab '%s'" % lib_stdcxx) raw_output = self.res.GetOutput() |