Skip to content
  1. Oct 15, 2010
    • Johnny Chen's avatar
      Add a test case for exercising breakpoint conditions using the lldb command: · 27b107b8
      Johnny Chen authored
          breakpoint modify -c 'val == 3' 1
      
      after:
      
          breakpoint set -n c
      
      which sets a breakpoint on function 'c'.  The breakpoint should only stop if
      expression 'val == 3' evaluates to true.
      
      llvm-svn: 116607
      27b107b8
    • Johnny Chen's avatar
      Add a const string for assert message. Remove extra printing of newlines from · 164f1e18
      Johnny Chen authored
      the session recordings.
      
      llvm-svn: 116596
      164f1e18
    • Johnny Chen's avatar
      Add more comments. · fd64df4f
      Johnny Chen authored
      llvm-svn: 116583
      fd64df4f
    • Johnny Chen's avatar
      Be more specific about cases whenthe runCmd() check flag is False, meaning there · ab254f5d
      Johnny Chen authored
      is no need to check the return status of the command execution, and an error
      status is not deemed a failure in the test.
      
      llvm-svn: 116582
      ab254f5d
    • Johnny Chen's avatar
      56f7939c
    • Johnny Chen's avatar
      This is an initial version of test driver enhanceent to be able to dump the · 150c3cc8
      Johnny Chen authored
      session info after a test case failure, allowing more direct inspection of
      debugger session which leads to the test failure.
      
      For a simple usage scenario:
      
      [18:06:26] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v . 2> ~/Developer/Log/lldbtest.log 
      
      ...
      
      [18:14:43] johnny:/Volumes/data/lldb/svn/trunk/test $ ls -l .session-*
      -rw-r--r--  1 johnny  admin  1359 Oct 14 18:06 .session-TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command
      -rw-r--r--  1 johnny  admin  2054 Oct 14 18:07 .session-TestClassTypes.ClassTypesTestCase.test_with_dsym_and_expr_parser
      -rw-r--r--  1 johnny  admin  2055 Oct 14 18:07 .session-TestClassTypes.ClassTypesTestCase.test_with_dwarf_and_expr_parser
      -rw-r--r--  1 johnny  admin  1351 Oct 14 17:57 .session-TestClassTypes.ClassTypesTestCase.test_with_dwarf_and_run_command
      [18:14:51] johnny:/Volumes/data/lldb/svn/trunk/test $ 
      
      The test case which failed will have its recorded session info dumped to a
      .session-* file in the current working directory.  For test suite using
      relocated directory, expect to find the .session-* files there.
      
      In this checkin, I also add @skip decorator to the two test methods in
      test/foundation/TestObjCMethods.py as it looks like the test suite is
      deadlocking when running the tests.  More investigations are needed.
      
      llvm-svn: 116552
      150c3cc8
  2. Oct 14, 2010
    • Johnny Chen's avatar
      Add an initial version of test that exercise the lldb commands: 'process signal' · c066ab43
      Johnny Chen authored
      and 'process handle'.  The test suite would like to control the asynch/sync
      execution of the interpreter during the middle of the test method, so the
      CommandInterpreter::SetSynchronous(bool value) is modified to allow the mode to
      be changed more than once.
      
      In practice, it would be advisable to control the process and to set the
      async/sync mode from a single thread, too.
      
      llvm-svn: 116467
      c066ab43
  3. Oct 12, 2010
    • Johnny Chen's avatar
      Avoid using hardcoded line number to break on. Use the line_number() utility · cd9b7779
      Johnny Chen authored
      function to get the line number to break on during setUp().
      
      llvm-svn: 116275
      cd9b7779
    • Johnny Chen's avatar
      Add a utility function to lldbtest.py to return the line number of a matched string · 47ceb032
      Johnny Chen authored
      within a file.  This is to be used within the test case to avoid hardcoded line number.
      
      array_types/TestArrayTypes.py is modified first to use this pattern.  Other test modules
      to follow.
      
      rdar://problem/8537816
      Testsuite: don't set breakpoints by exact file & line number
      
      llvm-svn: 116270
      47ceb032
    • Johnny Chen's avatar
      Added the capability for the test driver to relocate the tests and the intermediate · 707b3c9c
      Johnny Chen authored
      files to a different top level directory than those specified on the command line.
      
      When relocated, the test clanups normally performed afterwards after each test method
      and after each test class will not be exercised at all.  This allows for an easier
      postmortem analysis of test failures.
      
      Example:
      
      ./dotest.py -v -t -r /tmp/lldbtest types
      
      will create a /tmp/lldbtest directory which houses the types directory and its supported
      files.
      
      Files modified:
      
      o dotest.py, lldbtest.py:
      
        Add logic to process '-r dir' option to support relocating the tests to a different
        top level directory instead of exected in place.
      
      o darwin.py, test/types/Makefile:
      
        The 'make clean' should only clean the minimum .o and .d files.
      
      llvm-svn: 116255
      707b3c9c
  4. Oct 08, 2010
    • Johnny Chen's avatar
      o TestStdCXXDisassembly.py: · 65045f21
      Johnny Chen authored
        Update the expected match string.
      
      o lldbtest.py:
      
        Indicate when a command fails, even if there is nothing in the error stream.
      
      o TestHelp.py:
      
        Add a regression test case for 'help image dump symtab'.
      
      o CommandObjectHelp.cpp:
      
        Some of the logic branches with successful help command results were not tagged
        with a Success Status.  They are fixed now.  This is important for Python
        interaction.
      
      llvm-svn: 116062
      65045f21
    • Johnny Chen's avatar
      Move the enum to string utility functions from lldbtest.py to lldbuti.py and · 28ae2942
      Johnny Chen authored
      update the affected API clients.
      
      llvm-svn: 115995
      28ae2942
  5. Oct 07, 2010
    • Johnny Chen's avatar
    • Johnny Chen's avatar
      o SBtarget.cpp/.h: · 0ed37c96
      Johnny Chen authored
        Temporarily commenting out the deprecated LaunchProcess() method.
        SWIG is not able to handle the overloaded functions.
      
      o dotest.py/lldbtest.py:
      
        Add an '-w' option to insert some wait time between consecutive test cases.
      
      o TestClassTypes.py:
      
        Make the breakpoint_creation_by_filespec_python() test method more robust and
        more descriptive by printing out a more insightful assert message.
      
      o lldb.swig: Coaches swig to treat StateType as an int type, instead of a C++ class.
      
      llvm-svn: 115899
      0ed37c96
  6. Oct 05, 2010
  7. Oct 02, 2010
    • Johnny Chen's avatar
      o Added a new feature to the test framework to skip long running tests conditionally. · da88434b
      Johnny Chen authored
        To not skip long running tests, pass '-l' to the test driver (dotest.py).
      
        An example:
      
          @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")
          def test_foundation_disasm(self):
              ...
      
      o Added a long running disassemble test to the foundation directory, which iterates
        the code symbols from Foundation.framework and kicks off a disassemble command for
        for the named function symbol.  Found a crasher: rdar://problem/8504895.
      
      o Plus added/updated some comments for the TestBase class.
      
      llvm-svn: 115368
      da88434b
  8. Sep 30, 2010
  9. Sep 24, 2010
    • Johnny Chen's avatar
      Added a generic_type_tester() to the TestBasicTypes class to be used for · b052f6c5
      Johnny Chen authored
      testing various combinations of displaying variales of basic types.
      
      The generic_type_tester() works by first capturing the golden output produced
      by the printf stmts of ./a.out, creating a list of (var, value) pairs, and then
      running the a.out to a stop point, and comparing the 'frame variable var' output
      against the list of (var, value) pairs.
      
      Modified int_type() and added long_type() to use generic_type_tester().
      
      Also modified TestBase.expect() such that substring matching also return ok if
      the substring starts at the 0-th position.
      
      llvm-svn: 114708
      b052f6c5
  10. Sep 23, 2010
    • Johnny Chen's avatar
      Checked in an initial template for the types directory. Right now, it doesn't · c70b02a3
      Johnny Chen authored
      actually test-and-compare anything yet.  The lldbtest.TestBase has an added
      method setTearDownCleanup(dictionary=None) to facilitate running the cleanup
      right after each data type test is run.  The test case can pass a dictionary
      object when registering the test case cleanup.
      
      There is currently only int_type test in the repository.
      
      llvm-svn: 114600
      c70b02a3
  11. Sep 22, 2010
  12. Sep 21, 2010
    • Johnny Chen's avatar
      Added a more complex test case of breakpoint commands, which executes a sequence · ea88e943
      Johnny Chen authored
      of 'breakpoint command add/list/remove' commands to set breakpoint callbacks,
      list them, and then remove one.
      
      Modified the lldbtest.TestBase.expect() method to add two additional keyword
      arguments:
      
      o matching (default to True), which, if set to False, reverses the semantics of
        'expect' to 'expect not'
      
      o patterns (default to None), which specifies a list of regexp patterns to match
        against the output from running the command
      
      TestBreakpointCommand.py uses the matching=False and the patterns=[...] expect()
      API.
      
      llvm-svn: 114480
      ea88e943
  13. Sep 18, 2010
  14. Sep 16, 2010
    • Johnny Chen's avatar
      Added a test case for the settings command which sets process.output-path and · 2fcc0e55
      Johnny Chen authored
      checks that the launched process writes its standard output there.
      
      llvm-svn: 114102
      2fcc0e55
    • Johnny Chen's avatar
      Provided a mechanism for the test class to cleanup after itself once it's done. · 1a9f4dd5
      Johnny Chen authored
      This will remove the confusion experienced when previous test runs left some
      files (both intermediate or by-product as a result of the test).
      
      lldbtest.TestBase defines a classmethod tearDownClass(cls) which invokes the
      platform-specific cleanup() function as defined by the plugin; after that, it
      invokes a subclass-specific function classCleanup(cls) if defined; and, finally,
      it restores the old working directory.
      
      An example of classCleanup(cls) is in settings/TestSettings.py:
      
          @classmethod
          def classCleanup(cls):
              system(["/bin/sh", "-c", "rm output.txt"])
      
      where it deletes the by-product "output.txt" as a result of running a.out.
      
      llvm-svn: 114058
      1a9f4dd5
  15. Sep 15, 2010
  16. Sep 13, 2010
    • Johnny Chen's avatar
      Extend the build mechanism to allow for specifying the compiler used to build · 1394a4b7
      Johnny Chen authored
      the binaries.
      
      If the build* function is passed the compiler argument, for example, 'llvm-gcc',
      it is passed as a make variable to the make command.  Otherwise, we check the
      LLDB_CC environment variable; if it is defined, it is passed as a make variable
      to the make command.
      
      If neither the compiler keyword argument nor the LLDB_CC environment variable is
      specified, no CC make variable is passed to the make command.  The Makefile gets
      to define the default CC being used.
      
      --------------------------------------------------------------------------------
      Example usage follows:
      
      o Via the keyword argument:
      
      class ArrayTypesTestCase(TestBase):
      
          mydir = "array_types"
      
          @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
          def test_with_dsym_and_run_command(self):
              """Test 'frame variable var_name' on some variables with array types."""
              self.buildDsym(compiler='llvm-gcc')
              self.array_types()
      ...
      
      o Via LLDB_CC environment variable:
      
      $ LLDB_CC=llvm-gcc ./dotest.py -v -t array_types
      ----------------------------------------------------------------------
      Collected 4 tests
      
      test_with_dsym_and_python_api (TestArrayTypes.ArrayTypesTestCase)
      Use Python APIs to inspect variables with array types. ... 
      os command: [['/bin/sh', '-c', 'make clean; make MAKE_DSYM=YES CC=llvm-gcc']]
      output: rm -rf "a.out" "a.out.dSYM"  main.o main.d
      llvm-gcc -arch x86_64 -gdwarf-2 -O0 -arch x86_64 -gdwarf-2 -O0  -c -o main.o main.c
      llvm-gcc -arch x86_64 -gdwarf-2 -O0  main.o -o "a.out"
      /usr/bin/dsymutil  -o "a.out.dSYM" "a.out"
      
      ...
      
      llvm-svn: 113781
      1394a4b7
  17. Sep 07, 2010
  18. Sep 04, 2010
  19. Sep 03, 2010
  20. Sep 02, 2010
  21. Sep 01, 2010
Loading