# of 6.7kBps. Zooko's mom's 1.8GHz G5 got 2.2kBps . slave3 took 40s to
# construct the LUT and encodes at 1.5kBps, and for some reason took more
# than 20 minutes to run the test_encode_share tests, so I disabled most
- # of them.
+ # of them. (uh, hello, it's running figleaf)
def set_params(self, data_size, required_shares, total_shares):
assert required_shares <= total_shares
# finish in printSummary.
from allmydata.util import figleaf
-figleaf.start()
+# don't cover py_ecc, it takes forever
+from allmydata.py_ecc import rs_code
+import os
+py_ecc_dir = os.path.realpath(os.path.dirname(rs_code.__file__))
+figleaf.start(ignore_prefixes=[py_ecc_dir])
+
class FigleafReporter(TreeReporter):
def __init__(self, *args, **kwargs):
"""
Basic code coverage tracking, using sys.settrace.
"""
- def __init__(self, ignore_prefix=None):
+ def __init__(self, ignore_prefixes=[]):
self.c = {}
self.started = False
- self.ignore_prefix = ignore_prefix
+ self.ignore_prefixes = ignore_prefixes
def start(self):
"""
global trace function.
"""
if e is 'call':
- if self.ignore_prefix and \
- f.f_code.co_filename.startswith(self.ignore_prefix):
- return
+ for p in self.ignore_prefixes:
+ if f.f_code.co_filename.startswith(p):
+ return
return self.t
_t = None
-def start(ignore_python_lib=True):
+def start(ignore_python_lib=True, ignore_prefixes=[]):
"""
Start tracing code coverage. If 'ignore_python_lib' is True,
ignore all files that live below the same directory as the 'os'
"""
global _t
if _t is None:
- ignore_path = None
+ ignore_prefixes = ignore_prefixes[:]
if ignore_python_lib:
- ignore_path = os.path.realpath(os.path.dirname(os.__file__))
- _t = CodeTracer(ignore_path)
+ ignore_prefixes.append(os.path.realpath(os.path.dirname(os.__file__)))
+ _t = CodeTracer(ignore_prefixes)
_t.start()