Remove the -P option from dotest.py
authorZachary Turner <zturner@google.com>
Wed, 9 Dec 2015 20:48:59 +0000 (20:48 +0000)
committerZachary Turner <zturner@google.com>
Wed, 9 Dec 2015 20:48:59 +0000 (20:48 +0000)
This was an option to display a graphical progress bar.  Nobody
is using this, and it doesn't work correctly anyway with the new
result formatter.

llvm-svn: 255153

lldb/packages/Python/lldbsuite/test/configuration.py
lldb/packages/Python/lldbsuite/test/dotest.py
lldb/packages/Python/lldbsuite/test/dotest_args.py
lldb/packages/Python/lldbsuite/test/test_result.py
lldb/third_party/Python/module/progress/progress.py [deleted file]

index 6f5528b..4f71b0c 100644 (file)
@@ -130,9 +130,6 @@ svn_silent = True
 # Default verbosity is 0.
 verbose = 1
 
-# Set to True only if verbose is 0 and LLDB trace mode is off.
-progress_bar = False
-
 # By default, search from the script directory.
 # We can't use sys.path[0] to determine the script directory
 # because it doesn't work under a debugger
index 095d878..2eea55c 100644 (file)
@@ -27,7 +27,6 @@ import importlib
 import os
 import errno
 import platform
-import progress
 import signal
 import socket
 import subprocess
@@ -338,10 +337,6 @@ def parseOptionsAndInitTestdirs():
     if args.q:
         configuration.parsable = True
 
-    if args.P and not args.v:
-        configuration.progress_bar = True
-        configuration.verbose = 0
-
     if args.R:
         if args.R.startswith('-'):
             usage(parser)
@@ -1239,8 +1234,6 @@ def run_suite():
 
             if configuration.parsable:
                 v = 0
-            elif configuration.progress_bar:
-                v = 1
             else:
                 v = configuration.verbose
 
index 49a14ec..48fe5ed 100644 (file)
@@ -88,7 +88,6 @@ def create_parser():
     # Test-suite behaviour
     group = parser.add_argument_group('Runtime behaviour options')
     X('-d', 'Suspend the process after launch to wait indefinitely for a debugger to attach')
-    X('-P', "Use the graphic progress bar.")
     X('-q', "Don't print extra output from this script.")
     X('-S', "Skip the build and cleanup while running the test. Use this option with care as you would need to build the inferior(s) by hand and build the executable(s) with the correct name(s). This can be used with '-# n' to stress test certain test cases for n number of times")
     X('-t', 'Turn on tracing of lldb command and other detailed test executions')
index eb89b66..ae968e3 100644 (file)
@@ -77,16 +77,6 @@ class LLDBTestResult(unittest2.TextTestResult):
         # This counts from 1 .. suite.countTestCases().
         self.counter = 0
         (width, height) = LLDBTestResult.getTerminalSize()
-        self.progressbar = None
-        if width > 10 and not configuration.parsable and configuration.progress_bar:
-            try:
-                self.progressbar = progress.ProgressWithEvents(
-                    stdout=self.stream,
-                    start=0,
-                    end=configuration.suite.countTestCases(),
-                    width=width-10)
-            except:
-                self.progressbar = None
         self.results_formatter = configuration.results_formatter_object
 
     def _config_string(self, test):
diff --git a/lldb/third_party/Python/module/progress/progress.py b/lldb/third_party/Python/module/progress/progress.py
deleted file mode 100644 (file)
index 734627d..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/usr/bin/python
-
-from __future__ import print_function
-
-import use_lldb_suite
-import six
-
-import sys
-import time
-
-class ProgressBar(object):
-    """ProgressBar class holds the options of the progress bar.
-    The options are:
-        start   State from which start the progress. For example, if start is 
-                5 and the end is 10, the progress of this state is 50%
-        end     State in which the progress has terminated.
-        width   --
-        fill    String to use for "filled" used to represent the progress
-        blank   String to use for "filled" used to represent remaining space.
-        format  Format
-        incremental
-    """
-    light_block = six.unichr(0x2591).encode("utf-8")
-    solid_block = six.unichr(0x2588).encode("utf-8")
-    solid_right_arrow = six.unichr(0x25BA).encode("utf-8")
-    
-    def __init__(self, 
-                 start=0, 
-                 end=10, 
-                 width=12, 
-                 fill=six.unichr(0x25C9).encode("utf-8"), 
-                 blank=six.unichr(0x25CC).encode("utf-8"), 
-                 marker=six.unichr(0x25CE).encode("utf-8"), 
-                 format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', 
-                 incremental=True):
-        super(ProgressBar, self).__init__()
-
-        self.start = start
-        self.end = end
-        self.width = width
-        self.fill = fill
-        self.blank = blank
-        self.marker = marker
-        self.format = format
-        self.incremental = incremental
-        self.step = 100 / float(width) #fix
-        self.reset()
-
-    def __add__(self, increment):
-        increment = self._get_progress(increment)
-        if 100 > self.progress + increment:
-            self.progress += increment
-        else:
-            self.progress = 100
-        return self
-
-    def complete(self):
-        self.progress = 100
-        return self
-
-    def __str__(self):
-        progressed = int(self.progress / self.step) #fix
-        fill = progressed * self.fill
-        blank = (self.width - progressed) * self.blank
-        return self.format % {'fill': fill, 'blank': blank, 'marker': self.marker, 'progress': int(self.progress)}
-
-    __repr__ = __str__
-
-    def _get_progress(self, increment):
-        return float(increment * 100) / self.end
-
-    def reset(self):
-        """Resets the current progress to the start point"""
-        self.progress = self._get_progress(self.start)
-        return self
-
-
-class AnimatedProgressBar(ProgressBar):
-    """Extends ProgressBar to allow you to use it straighforward on a script.
-    Accepts an extra keyword argument named `stdout` (by default use sys.stdout)
-    and may be any file-object to which send the progress status.
-    """
-    def __init__(self, 
-                 start=0, 
-                 end=10, 
-                 width=12, 
-                 fill=six.unichr(0x25C9).encode("utf-8"), 
-                 blank=six.unichr(0x25CC).encode("utf-8"), 
-                 marker=six.unichr(0x25CE).encode("utf-8"), 
-                 format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', 
-                 incremental=True,
-                 stdout=sys.stdout):
-        super(AnimatedProgressBar, self).__init__(start,end,width,fill,blank,marker,format,incremental)
-        self.stdout = stdout
-
-    def show_progress(self):
-        if hasattr(self.stdout, 'isatty') and self.stdout.isatty():
-            self.stdout.write('\r')
-        else:
-            self.stdout.write('\n')
-        self.stdout.write(str(self))
-        self.stdout.flush()
-
-class ProgressWithEvents(AnimatedProgressBar):
-    """Extends AnimatedProgressBar to allow you to track a set of events that
-       cause the progress to move. For instance, in a deletion progress bar, you
-       can track files that were nuked and files that the user doesn't have access to
-    """
-    def __init__(self, 
-                 start=0, 
-                 end=10, 
-                 width=12, 
-                 fill=six.unichr(0x25C9).encode("utf-8"), 
-                 blank=six.unichr(0x25CC).encode("utf-8"), 
-                 marker=six.unichr(0x25CE).encode("utf-8"), 
-                 format='[%(fill)s%(marker)s%(blank)s] %(progress)s%%', 
-                 incremental=True,
-                 stdout=sys.stdout):
-        super(ProgressWithEvents, self).__init__(start,end,width,fill,blank,marker,format,incremental,stdout)
-        self.events = {}
-
-    def add_event(self,event):
-        if event in self.events:
-            self.events[event] += 1
-        else:
-            self.events[event] = 1
-
-    def show_progress(self):
-        isatty = hasattr(self.stdout, 'isatty') and self.stdout.isatty()
-        if isatty:
-            self.stdout.write('\r')
-        else:
-            self.stdout.write('\n')
-        self.stdout.write(str(self))
-        if len(self.events) == 0:
-            return
-        self.stdout.write('\n')
-        for key in list(self.events.keys()):
-            self.stdout.write(str(key) + ' = ' + str(self.events[key]) + ' ')
-        if isatty:
-            self.stdout.write('\033[1A')
-        self.stdout.flush()
-
-
-if __name__ == '__main__':
-    p = AnimatedProgressBar(end=200, width=200)
-
-    while True:
-        p + 5
-        p.show_progress()
-        time.sleep(0.3)
-        if p.progress == 100:
-            break
-    print() #new line
\ No newline at end of file