Lines Matching refs:self
50 def __init__(self, config, args={}):
51 self.name = config.pop('name')
52 self.path = config.pop('path')
53 self.suite = config.pop('suite')
54 self.lineno = config.pop('lineno', None)
55 self.if_ = config.pop('if', None)
56 if isinstance(self.if_, bool):
57 self.if_ = 'true' if self.if_ else 'false'
58 self.code = config.pop('code')
59 self.code_lineno = config.pop('code_lineno', None)
60 self.in_ = config.pop('in',
64 self.defines = set()
65 self.permutations = []
128 self.defines |= suite_defines_.keys()
130 self.defines |= defines_.keys()
131 self.permutations.extend(dict(perm) for perm in it.product(*(
139 self.name,
146 def __init__(self, path, args={}):
147 self.path = path
148 self.name = os.path.basename(path)
149 if self.name.endswith('.toml'):
150 self.name = self.name[:-len('.toml')]
153 with open(self.path) as f:
184 self.if_ = config.pop('if', None)
185 if isinstance(self.if_, bool):
186 self.if_ = 'true' if self.if_ else 'false'
188 self.code = config.pop('code', None)
189 self.code_lineno = min(
198 self.cases = []
201 self.cases.append(BenchCase(config={
205 'suite': self.name,
212 self.defines = set.union(*(
213 set(case.defines) for case in self.cases))
219 self.name,
711 def __init__(self, path, head=None, tail=None):
712 self.f = openio(path, 'w+', 1)
713 self.lock = th.Lock()
714 self.head = head or []
715 self.tail = tail or []
716 self.writer = csv.DictWriter(self.f, self.head + self.tail)
717 self.rows = []
719 def close(self):
720 self.f.close()
722 def __enter__(self):
723 return self
725 def __exit__(self, *_):
726 self.f.close()
728 def writerow(self, row):
729 with self.lock:
730 self.rows.append(row)
731 if all(k in self.head or k in self.tail for k in row.keys()):
733 self.writer.writerow(row)
736 self.head.extend(row.keys() - (self.head + self.tail))
737 self.f.seek(0)
738 self.f.truncate()
739 self.writer = csv.DictWriter(self.f, self.head + self.tail)
740 self.writer.writeheader()
741 for row in self.rows:
742 self.writer.writerow(row)
746 def __init__(self, id, returncode, stdout, assert_=None):
747 self.id = id
748 self.returncode = returncode
749 self.stdout = stdout
750 self.assert_ = assert_