summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-08-27 18:18:46 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-08-27 18:18:46 +0000
commit2d247359cc399d283ae00c6b869ee05617f36e2b (patch)
tree004105e01b12a12fdbe1c1790ac0b0c331d1066b /lldb/packages/Python/lldbsuite
parentff07631b481ee2396aa1bbaadefcbd537d787b08 (diff)
downloadbcm5719-llvm-2d247359cc399d283ae00c6b869ee05617f36e2b.tar.gz
bcm5719-llvm-2d247359cc399d283ae00c6b869ee05617f36e2b.zip
[dotest] Remove results port
The results port was used by dosep.py to deal with test results coming form different processes. With dosep.py gone, I don't think we need this any longer. Differential revision: https://reviews.llvm.org/D66811 llvm-svn: 370090
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/configuration.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/dotest_args.py6
-rw-r--r--lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py43
-rw-r--r--lldb/packages/Python/lldbsuite/test_event/formatter/curses.py4
-rw-r--r--lldb/packages/Python/lldbsuite/test_event/formatter/pickled.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test_event/formatter/results_formatter.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test_event/formatter/xunit.py4
8 files changed, 9 insertions, 72 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py
index c22320fdccb..5574f71de3f 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -117,7 +117,6 @@ exclusive_test_subdir = None
# Test results handling globals
results_filename = None
-results_port = None
results_formatter_name = None
results_formatter_object = None
results_formatter_options = None
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index c27b2c18330..4724b8ea9a2 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -429,15 +429,6 @@ def parseOptionsAndInitTestdirs():
if args.results_file:
configuration.results_filename = args.results_file
- if args.results_port:
- configuration.results_port = args.results_port
-
- if args.results_file and args.results_port:
- sys.stderr.write(
- "only one of --results-file and --results-port should "
- "be specified\n")
- usage(args)
-
if args.results_formatter:
configuration.results_formatter_name = args.results_formatter
if args.results_formatter_options:
@@ -516,7 +507,6 @@ def setupTestResults():
formatter_config.formatter_name = configuration.results_formatter_name
formatter_config.formatter_options = (
configuration.results_formatter_options)
- formatter_config.port = configuration.results_port
# Create the results formatter.
formatter_spec = formatter.create_results_formatter(
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 436ccd7fcdb..628aa411991 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -231,12 +231,6 @@ def create_parser():
help=('Specifies the file where test results will be written '
'according to the results-formatter class used'))
group.add_argument(
- '--results-port',
- action='store',
- type=int,
- help=('Specifies the localhost port to which the results '
- 'formatted output should be sent'))
- group.add_argument(
'--results-formatter',
action='store',
help=('Specifies the full package/module/class name used to translate '
diff --git a/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py b/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py
index 3bb482cc8fc..1fe6ecd3ef8 100644
--- a/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py
+++ b/lldb/packages/Python/lldbsuite/test_event/formatter/__init__.py
@@ -24,7 +24,6 @@ class FormatterConfig(object):
def __init__(self):
self.filename = None
- self.port = None
self.formatter_name = None
self.formatter_options = None
@@ -48,43 +47,10 @@ def create_results_formatter(config):
@return an instance of CreatedFormatter.
"""
- def create_socket(port):
- """Creates a socket to the localhost on the given port.
-
- @param port the port number of the listening port on
- the localhost.
-
- @return (socket object, socket closing function)
- """
-
- def socket_closer(open_sock):
- """Close down an opened socket properly."""
- open_sock.shutdown(socket.SHUT_RDWR)
- open_sock.close()
-
- sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.connect(("localhost", port))
-
- # Wait for the ack from the listener side.
- # This is needed to prevent a race condition
- # in the main dosep.py processing loop: we
- # can't allow a worker queue thread to die
- # that has outstanding messages to a listener
- # socket before the listener socket asyncore
- # listener socket gets spun up; otherwise,
- # we lose the test result info.
- read_bytes = sock.recv(1)
- if read_bytes is None or (len(read_bytes) < 1) or (read_bytes != b'*'):
- raise Exception(
- "listening socket did not respond with ack byte: response={}".format(read_bytes))
-
- return sock, lambda: socket_closer(sock)
-
default_formatter_name = None
results_file_object = None
cleanup_func = None
- file_is_stream = False
if config.filename:
# Open the results file for writing.
if config.filename == 'stdout':
@@ -98,12 +64,6 @@ def create_results_formatter(config):
cleanup_func = results_file_object.close
default_formatter_name = (
"lldbsuite.test_event.formatter.xunit.XunitFormatter")
- elif config.port:
- # Connect to the specified localhost port.
- results_file_object, cleanup_func = create_socket(config.port)
- default_formatter_name = (
- "lldbsuite.test_event.formatter.pickled.RawPickledFormatter")
- file_is_stream = True
# If we have a results formatter name specified and we didn't specify
# a results file, we should use stdout.
@@ -141,8 +101,7 @@ def create_results_formatter(config):
# Create the TestResultsFormatter given the processed options.
results_formatter_object = cls(
results_file_object,
- formatter_options,
- file_is_stream)
+ formatter_options)
def shutdown_formatter():
"""Shuts down the formatter when it is no longer needed."""
diff --git a/lldb/packages/Python/lldbsuite/test_event/formatter/curses.py b/lldb/packages/Python/lldbsuite/test_event/formatter/curses.py
index 05b773f9e69..c265f03c38b 100644
--- a/lldb/packages/Python/lldbsuite/test_event/formatter/curses.py
+++ b/lldb/packages/Python/lldbsuite/test_event/formatter/curses.py
@@ -26,9 +26,9 @@ from ..event_builder import EventBuilder
class Curses(results_formatter.ResultsFormatter):
"""Receives live results from tests that are running and reports them to the terminal in a curses GUI"""
- def __init__(self, out_file, options, file_is_stream):
+ def __init__(self, out_file, options):
# Initialize the parent
- super(Curses, self).__init__(out_file, options, file_is_stream)
+ super(Curses, self).__init__(out_file, options)
self.using_terminal = True
self.have_curses = True
self.initialize_event = None
diff --git a/lldb/packages/Python/lldbsuite/test_event/formatter/pickled.py b/lldb/packages/Python/lldbsuite/test_event/formatter/pickled.py
index acb5c56e028..0ce7a4ef913 100644
--- a/lldb/packages/Python/lldbsuite/test_event/formatter/pickled.py
+++ b/lldb/packages/Python/lldbsuite/test_event/formatter/pickled.py
@@ -46,18 +46,14 @@ class RawPickledFormatter(ResultsFormatter):
def serialize(test_event, out_file):
cPickle.dump(test_event, out_file)
- def __init__(self, out_file, options, file_is_stream):
+ def __init__(self, out_file, options):
super(
RawPickledFormatter,
self).__init__(
out_file,
- options,
- file_is_stream)
+ options)
self.pid = os.getpid()
- if file_is_stream:
- self.serializer = self.StreamSerializer()
- else:
- self.serializer = self.BlockSerializer()
+ self.serializer = self.BlockSerializer()
def handle_event(self, test_event):
super(RawPickledFormatter, self).handle_event(test_event)
diff --git a/lldb/packages/Python/lldbsuite/test_event/formatter/results_formatter.py b/lldb/packages/Python/lldbsuite/test_event/formatter/results_formatter.py
index ac2778e55de..140a3192874 100644
--- a/lldb/packages/Python/lldbsuite/test_event/formatter/results_formatter.py
+++ b/lldb/packages/Python/lldbsuite/test_event/formatter/results_formatter.py
@@ -114,7 +114,7 @@ class ResultsFormatter(object):
'the summary output.'))
return parser
- def __init__(self, out_file, options, file_is_stream):
+ def __init__(self, out_file, options):
super(ResultsFormatter, self).__init__()
self.out_file = out_file
self.options = options
@@ -123,7 +123,6 @@ class ResultsFormatter(object):
raise Exception("ResultsFormatter created with no file object")
self.start_time_by_test = {}
self.terminate_called = False
- self.file_is_stream = file_is_stream
# Track the most recent test start event by worker index.
# We'll use this to assign TIMEOUT and exceptional
diff --git a/lldb/packages/Python/lldbsuite/test_event/formatter/xunit.py b/lldb/packages/Python/lldbsuite/test_event/formatter/xunit.py
index 9e360459d4c..e480df59a2f 100644
--- a/lldb/packages/Python/lldbsuite/test_event/formatter/xunit.py
+++ b/lldb/packages/Python/lldbsuite/test_event/formatter/xunit.py
@@ -155,14 +155,14 @@ class XunitFormatter(ResultsFormatter):
regex_list.append(re.compile(pattern))
return regex_list
- def __init__(self, out_file, options, file_is_stream):
+ def __init__(self, out_file, options):
"""Initializes the XunitFormatter instance.
@param out_file file-like object where formatted output is written.
@param options specifies a dictionary of options for the
formatter.
"""
# Initialize the parent
- super(XunitFormatter, self).__init__(out_file, options, file_is_stream)
+ super(XunitFormatter, self).__init__(out_file, options)
self.text_encoding = "UTF-8"
self.invalid_xml_re = XunitFormatter._build_illegal_xml_regex()
self.total_test_count = 0
OpenPOWER on IntegriCloud