Home | History | Annotate | Download | only in test
      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
     10 config: {'pre_flight': <function pre_flight at 0x107042140>}
     11 LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
     12 LLDB-165
     13 Path: /Volumes/data/lldb/svn/ToT
     14 URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
     15 Repository Root: https://johnny@llvm.org/svn/llvm-project
     16 Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
     17 Revision: 162231
     18 Node Kind: directory
     19 Schedule: normal
     20 Last Changed Author: johnny
     21 Last Changed Rev: 162228
     22 Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
     23 
     24 
     25 lldb.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 
     35 lldb.post_flight: None
     36 
     37 Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-11_36_37'
     38 Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
     39 compilers=['clang']
     40 
     41 Configuration: arch=x86_64 compiler=clang
     42 ----------------------------------------------------------------------
     43 Collected 2 tests
     44 
     45 1: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
     46    Test a sequence of breakpoint command add, list, and delete. ... 
     47 Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
     48 with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dsym.txt
     49 ok
     50 2: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
     51    Test a sequence of breakpoint command add, list, and delete. ... 
     52 Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
     53 with log destination: /tmp/lldb_log-x86_64-clang-TestBreakpointCommand.BreakpointCommandTestCase.test_with_dwarf.txt
     54 ok
     55 
     56 ----------------------------------------------------------------------
     57 Ran 2 tests in 7.826s
     58 
     59 OK
     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
     71 config: {'pre_flight': <function pre_flight at 0x10ca5c1b8>}
     72 LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
     73 LLDB-165
     74 Path: /Volumes/data/lldb/svn/ToT
     75 URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
     76 Repository Root: https://johnny@llvm.org/svn/llvm-project
     77 Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
     78 Revision: 162231
     79 Node Kind: directory
     80 Schedule: normal
     81 Last Changed Author: johnny
     82 Last Changed Rev: 162228
     83 Last Changed Date: 2012-08-20 14:16:02 -0700 (Mon, 20 Aug 2012)
     84 
     85 
     86 lldb.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                          os.environ["LLDB_SESSION_DIRNAME"])
     93     if not os.path.isdir(dname):
     94         os.mkdir(dname)
     95     dest = os.path.join(dname, "lldb_log-%s-%s-%s.txt" % (self.getArchitecture(), self.getCompiler(), self.id()))
     96     print "\nEnabling lldb logging for test case:", self
     97     print "with log destination:", dest
     98     self.runCmd("log enable -f %s gdb-remote packets process" % dest)
     99 
    100 lldb.post_flight: None
    101 
    102 Session logs for test failures/errors/unexpected successes will go into directory '2012-08-22-13_21_46'
    103 Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-loggings functionalities/breakpoint/breakpoint_command
    104 compilers=['clang']
    105 
    106 Configuration: arch=x86_64 compiler=clang
    107 ----------------------------------------------------------------------
    108 Collected 2 tests
    109 
    110 1: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
    111    Test a sequence of breakpoint command add, list, and delete. ... 
    112 Enabling lldb logging for test case: test_with_dsym (TestBreakpointCommand.BreakpointCommandTestCase)
    113 with 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
    114 ok
    115 2: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
    116    Test a sequence of breakpoint command add, list, and delete. ... 
    117 Enabling lldb logging for test case: test_with_dwarf (TestBreakpointCommand.BreakpointCommandTestCase)
    118 with 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
    119 ok
    120 
    121 ----------------------------------------------------------------------
    122 Ran 2 tests in 8.575s
    123 
    124 OK
    125 [13:21:55] johnny:/Volumes/data/lldb/svn/ToT/test $ 
    126