[Lldb-commits] [lldb] r255143 - Remove -k command line option from dotest.py.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 9 11:45:52 PST 2015


Author: zturner
Date: Wed Dec  9 13:45:51 2015
New Revision: 255143

URL: http://llvm.org/viewvc/llvm-project?rev=255143&view=rev
Log:
Remove -k command line option from dotest.py.

This is part of an effort to remove unused command line options.

Removed:
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestRunHooksThenSteppings.py
Modified:
    lldb/trunk/packages/Python/lldbsuite/test/configuration.py
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py
    lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py

Removed: lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestRunHooksThenSteppings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestRunHooksThenSteppings.py?rev=255142&view=auto
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestRunHooksThenSteppings.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestRunHooksThenSteppings.py (removed)
@@ -1,65 +0,0 @@
-"""Test lldb's stepping speed."""
-
-from __future__ import print_function
-
-
-
-import os, sys
-import lldb
-from lldbsuite.test import configuration
-from lldbsuite.test.lldbbench import *
-
-class RunHooksThenSteppingsBench(BenchBase):
-
-    mydir = TestBase.compute_mydir(__file__)
-
-    def setUp(self):
-        BenchBase.setUp(self)
-        self.count = configuration.bmIterationCount
-        if self.count <= 0:
-            self.count = 50
-
-    @benchmarks_test
-    @no_debug_info_test
-    @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    def test_lldb_runhooks_then_steppings(self):
-        """Test lldb steppings on a large executable."""
-        print()
-        self.run_lldb_runhooks_then_steppings(self.count)
-        print("lldb stepping benchmark:", self.stopwatch)
-
-    def run_lldb_runhooks_then_steppings(self, count):
-        import pexpect
-        # Set self.child_prompt, which is "(lldb) ".
-        self.child_prompt = '(lldb) '
-        prompt = self.child_prompt
-
-        self.child = pexpect.spawn('%s %s' % (lldbtest_config.lldbExec, self.lldbOption))
-        self.child.expect_exact(prompt)
-        # So that the child gets torn down after the test.
-        child = self.child
-
-        # Turn on logging for what the child sends back.
-        if self.TraceOn():
-            child.logfile_read = sys.stdout
-
-        #lldb.runHooks = ['process attach -n Mail']
-
-        # Perform the run hooks to bring lldb debugger to the desired state.
-        self.runHooks(child=child, child_prompt=prompt)
-
-        # Reset the stopwatch now.
-        self.stopwatch.reset()
-        for i in range(count):
-            with self.stopwatch:
-                # Step through the function.
-                child.sendline('next') # Aka 'thread step-over'.
-                child.expect_exact(prompt)
-
-        child.sendline('quit')
-        try:
-            self.child.expect(pexpect.EOF)
-        except:
-            pass
-
-        self.child = None

Modified: lldb/trunk/packages/Python/lldbsuite/test/configuration.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/configuration.py?rev=255143&r1=255142&r2=255143&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/configuration.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/configuration.py Wed Dec  9 13:45:51 2015
@@ -97,10 +97,6 @@ failfast = False
 # The filters (testclass.testmethod) used to admit tests into our test suite.
 filters = []
 
-# The runhooks is a list of lldb commands specifically for the debugger.
-# Use '-k' to specify a runhook.
-runHooks = []
-
 # Ignore the build search path relative to this script to locate the lldb.py module.
 ignore = False
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=255143&r1=255142&r2=255143&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Wed Dec  9 13:45:51 2015
@@ -327,9 +327,6 @@ def parseOptionsAndInitTestdirs():
     if args.i:
         configuration.ignore = True
 
-    if args.k:
-        configuration.runHooks.extend(args.k)
-
     if args.l:
         configuration.skip_long_running_test = False
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=255143&r1=255142&r2=255143&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Wed Dec  9 13:45:51 2015
@@ -70,7 +70,6 @@ def create_parser():
     group = parser.add_argument_group('Configuration options')
     group.add_argument('--framework', metavar='framework-path', help='The path to LLDB.framework')
     group.add_argument('--executable', metavar='executable-path', help='The path to the lldb executable')
-    group.add_argument('-k', metavar='command', action='append', help="Specify a runhook, which is an lldb command to be executed by the debugger; The option can occur multiple times. The commands are executed one after the other to bring the debugger to a desired state, so that, for example, further benchmarking can be done")
     group.add_argument('-R', metavar='dir', help='Specify a directory to relocate the tests and their intermediate files to. BE WARNED THAT the directory, if exists, will be deleted before running this test driver. No cleanup of intermediate test files is performed in this case')
     group.add_argument('-r', metavar='dir', help="Similar to '-R', except that the directory must not exist before running this test driver")
     group.add_argument('-s', metavar='name', help='Specify the name of the dir created to store the session files of tests with errored or failed status. If not specified, the test driver uses the timestamp as the session dir name')

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=255143&r1=255142&r2=255143&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Wed Dec  9 13:45:51 2015
@@ -1535,30 +1535,6 @@ class Base(unittest2.TestCase):
         #Initialize debug_info
         self.debug_info = None
 
-    def runHooks(self, child=None, child_prompt=None, use_cmd_api=False):
-        """Perform the run hooks to bring lldb debugger to the desired state.
-
-        By default, expect a pexpect spawned child and child prompt to be
-        supplied (use_cmd_api=False).  If use_cmd_api is true, ignore the child
-        and child prompt and use self.runCmd() to run the hooks one by one.
-
-        Note that child is a process spawned by pexpect.spawn().  If not, your
-        test case is mostly likely going to fail.
-
-        See also dotest.py where lldb.runHooks are processed/populated.
-        """
-        if not configuration.runHooks:
-            self.skipTest("No runhooks specified for lldb, skip the test")
-        if use_cmd_api:
-            for hook in lldb.runhooks:
-                self.runCmd(hook)
-        else:
-            if not child or not child_prompt:
-                self.fail("Both child and child_prompt need to be defined.")
-            for hook in lldb.runHooks:
-                child.sendline(hook)
-                child.expect_exact(child_prompt)
-
     def setAsync(self, value):
         """ Sets async mode to True/False and ensures it is reset after the testcase completes."""
         old_async = self.dbg.GetAsync()




More information about the lldb-commits mailing list