Update test/3rdparty with the packages required to run the test suite in parallel mode. Change the short command line flag to "-j", matching make.
--HG-- rename : test/3rdparty/testscenarios-0.2/.bzrignore => test/3rdparty/testscenarios-0.4/.bzrignore rename : test/3rdparty/testscenarios-0.2/Apache-2.0 => test/3rdparty/testscenarios-0.4/Apache-2.0 rename : test/3rdparty/testscenarios-0.2/BSD => test/3rdparty/testscenarios-0.4/BSD rename : test/3rdparty/testscenarios-0.2/COPYING => test/3rdparty/testscenarios-0.4/COPYING rename : test/3rdparty/testscenarios-0.2/GOALS => test/3rdparty/testscenarios-0.4/GOALS rename : test/3rdparty/testscenarios-0.2/HACKING => test/3rdparty/testscenarios-0.4/HACKING rename : test/3rdparty/testscenarios-0.2/MANIFEST.in => test/3rdparty/testscenarios-0.4/MANIFEST.in rename : test/3rdparty/testscenarios-0.2/Makefile => test/3rdparty/testscenarios-0.4/Makefile rename : test/3rdparty/testscenarios-0.2/doc/__init__.py => test/3rdparty/testscenarios-0.4/doc/__init__.py rename : test/3rdparty/testscenarios-0.2/doc/example.py => test/3rdparty/testscenarios-0.4/doc/example.py rename : test/3rdparty/testscenarios-0.2/doc/test_sample.py => test/3rdparty/testscenarios-0.4/doc/test_sample.py rename : test/3rdparty/testtools-0.9.12/doc/conf.py => test/3rdparty/testtools-0.9.34/doc/conf.py rename : test/3rdparty/testtools-0.9.12/doc/make.bat => test/3rdparty/testtools-0.9.34/doc/make.bat rename : test/3rdparty/testtools-0.9.12/testtools/_compat2x.py => test/3rdparty/testtools-0.9.34/testtools/_compat2x.py rename : test/3rdparty/testtools-0.9.12/testtools/_spinner.py => test/3rdparty/testtools-0.9.34/testtools/_spinner.py rename : test/3rdparty/testtools-0.9.12/testtools/distutilscmd.py => test/3rdparty/testtools-0.9.34/testtools/distutilscmd.py rename : test/3rdparty/testtools-0.9.12/testtools/monkey.py => test/3rdparty/testtools-0.9.34/testtools/monkey.py rename : test/3rdparty/testtools-0.9.12/testtools/tests/test_monkey.py => test/3rdparty/testtools-0.9.34/testtools/tests/test_monkey.py rename : test/3rdparty/testtools-0.9.12/testtools/tests/test_runtest.py => test/3rdparty/testtools-0.9.34/testtools/tests/test_runtest.py rename : test/3rdparty/testtools-0.9.12/testtools/utils.py => test/3rdparty/testtools-0.9.34/testtools/utils.py
This commit is contained in:
106
test/3rdparty/python-subunit-0.0.16/python/subunit/progress_model.py
vendored
Normal file
106
test/3rdparty/python-subunit-0.0.16/python/subunit/progress_model.py
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
#
|
||||
# subunit: extensions to Python unittest to get test results from subprocesses.
|
||||
# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net>
|
||||
#
|
||||
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
|
||||
# license at the users choice. A copy of both licenses are available in the
|
||||
# project source as Apache-2.0 and BSD. You may not use this file except in
|
||||
# compliance with one of these two licences.
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# license you chose for the specific language governing permissions and
|
||||
# limitations under that license.
|
||||
#
|
||||
|
||||
"""Support for dealing with progress state."""
|
||||
|
||||
class ProgressModel(object):
|
||||
"""A model of progress indicators as subunit defines it.
|
||||
|
||||
Instances of this class represent a single logical operation that is
|
||||
progressing. The operation may have many steps, and some of those steps may
|
||||
supply their own progress information. ProgressModel uses a nested concept
|
||||
where the overall state can be pushed, creating new starting state, and
|
||||
later pushed to return to the prior state. Many user interfaces will want
|
||||
to display an overall summary though, and accordingly the pos() and width()
|
||||
methods return overall summary information rather than information on the
|
||||
current subtask.
|
||||
|
||||
The default state is 0/0 - indicating that the overall progress is unknown.
|
||||
Anytime the denominator of pos/width is 0, rendering of a ProgressModel
|
||||
should should take this into consideration.
|
||||
|
||||
:ivar: _tasks. This private attribute stores the subtasks. Each is a tuple:
|
||||
pos, width, overall_numerator, overall_denominator. The overall fields
|
||||
store the calculated overall numerator and denominator for the state
|
||||
that was pushed.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""Create a ProgressModel.
|
||||
|
||||
The new model has no progress data at all - it will claim a summary
|
||||
width of zero and position of 0.
|
||||
"""
|
||||
self._tasks = []
|
||||
self.push()
|
||||
|
||||
def adjust_width(self, offset):
|
||||
"""Adjust the with of the current subtask."""
|
||||
self._tasks[-1][1] += offset
|
||||
|
||||
def advance(self):
|
||||
"""Advance the current subtask."""
|
||||
self._tasks[-1][0] += 1
|
||||
|
||||
def pop(self):
|
||||
"""Pop a subtask off the ProgressModel.
|
||||
|
||||
See push for a description of how push and pop work.
|
||||
"""
|
||||
self._tasks.pop()
|
||||
|
||||
def pos(self):
|
||||
"""Return how far through the operation has progressed."""
|
||||
if not self._tasks:
|
||||
return 0
|
||||
task = self._tasks[-1]
|
||||
if len(self._tasks) > 1:
|
||||
# scale up the overall pos by the current task or preserve it if
|
||||
# no current width is known.
|
||||
offset = task[2] * (task[1] or 1)
|
||||
else:
|
||||
offset = 0
|
||||
return offset + task[0]
|
||||
|
||||
def push(self):
|
||||
"""Push a new subtask.
|
||||
|
||||
After pushing a new subtask, the overall progress hasn't changed. Calls
|
||||
to adjust_width, advance, set_width will only after the progress within
|
||||
the range that calling 'advance' would have before - the subtask
|
||||
represents progressing one step in the earlier task.
|
||||
|
||||
Call pop() to restore the progress model to the state before push was
|
||||
called.
|
||||
"""
|
||||
self._tasks.append([0, 0, self.pos(), self.width()])
|
||||
|
||||
def set_width(self, width):
|
||||
"""Set the width of the current subtask."""
|
||||
self._tasks[-1][1] = width
|
||||
|
||||
def width(self):
|
||||
"""Return the total width of the operation."""
|
||||
if not self._tasks:
|
||||
return 0
|
||||
task = self._tasks[-1]
|
||||
if len(self._tasks) > 1:
|
||||
# scale up the overall width by the current task or preserve it if
|
||||
# no current width is known.
|
||||
return task[3] * (task[1] or 1)
|
||||
else:
|
||||
return task[1]
|
||||
|
||||
Reference in New Issue
Block a user