1#
2# The following example shows how to utilize the pre-flight config file to route the lldb gdb-remote log messages
3# into individual log destinations.
4#
5# See also .lldb-loggings in this directory as well as the tmp dir which contains the two log files abridged due
6# to their log sizes.
7#
8
9[11:31:34] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
10config: {'pre_flight': <function pre_flight at 0x107042140>}
11LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
12LLDB-165
13Path: /Volumes/data/lldb/svn/ToT
14URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
15Repository Root: https://johnny@llvm.org/svn/llvm-project
16Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
17Revision: 162231
18Node Kind: directory
19Schedule: normal
20Last Changed Author: johnny
21Last Changed Rev: 162228
22Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
23
24
25lldb.pre_flight: def pre_flight(self):
26    import os
27    import lldb
28    import lldbtest
29
30    dest = os.path.join("/tmp", "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))
31    print "\nEnabling lldb logging for test case:", self
32    print "with log destination:", dest
33    self.runCmd("log enable -f %s gdb-remote packets process" % dest)
34
35lldb.post_flight: None
36
37Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-11_36_37'
38Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
39compilers=['clang']
40
41Configuration: arch=x86_64 compiler=clang
42----------------------------------------------------------------------
43Collected 2 tests
44
451: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
46   Test a sequence of breakpoint command add, list, and delete. ...
47Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
48with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
49ok
502: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
51   Test a sequence of breakpoint command add, list, and delete. ...
52Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
53with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
54ok
55
56----------------------------------------------------------------------
57Ran 2 tests in 7.826s
58
59OK
60[11:36:44] johnny:/Volumes/data/lldb/svn/ToT/test $ ls -l /tmp/lldb_log*
61-rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
62-rw-r-----  1 johnny  wheel  614614 Aug 22 11:36 /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
63[11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $
64
65#
66# And this shows the log files go into the session directory.
67# Note that the .lldb-loggings file is modified to get the session directory now.
68#
69
70[11:37:09] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
71config: {'pre_flight': <function pre_flight at 0x10ca5c1b8>}
72LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
73LLDB-165
74Path: /Volumes/data/lldb/svn/ToT
75URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
76Repository Root: https://johnny@llvm.org/svn/llvm-project
77Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
78Revision: 162231
79Node Kind: directory
80Schedule: normal
81Last Changed Author: johnny
82Last Changed Rev: 162228
83Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
84
85
86lldb.pre_flight: def pre_flight(self):
87    import os
88    import lldb
89    import lldbtest
90
91    dname = os.path.join(os.environ["LLDB_TEST"])
92    if not os.path.isdir(dname):
93        os.mkdir(dname)
94    dest = os.path.join(dname, "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))
95    print "\nEnabling lldb logging for test case:", self
96    print "with log destination:", dest
97    self.runCmd("log enable -f %s gdb-remote packets process" % dest)
98
99lldb.post_flight: None
100
101Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-13_21_46'
102Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
103compilers=['clang']
104
105Configuration: arch=x86_64 compiler=clang
106----------------------------------------------------------------------
107Collected 2 tests
108
1091: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
110   Test a sequence of breakpoint command add, list, and delete. ...
111Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
112with log destination: /Volumes/data/lldb/svn/ToT/test/2012-08-22-13_21_46/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
113ok
1142: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
115   Test a sequence of breakpoint command add, list, and delete. ...
116Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
117with log destination: /Volumes/data/lldb/svn/ToT/test/2012-08-22-13_21_46/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
118ok
119
120----------------------------------------------------------------------
121Ran 2 tests in 8.575s
122
123OK
124[13:21:55] johnny:/Volumes/data/lldb/svn/ToT/test $
125