def filter(self, filter): if filter.all_same() or not self.child_tests: return self if filter.match() else None tests = TestTree(( (child, UnitTest(self.unit_executable, self.test + "." + child)) for child in self.child_tests)) return tests.filter(filter)
def configure(self, conf): unit_executable = join(conf['BUILD_DIR'], "rethinkdb-unittest") output = check_output([unit_executable, "--gtest_list_tests"]) key = None dict = defaultdict(list) for line in output.split("\n"): if not line: continue elif line[-1] == '.': key = line[:-1] else: dict[key].append(line.strip()) tests = TestTree( (group, UnitTest(unit_executable, group, tests)) for group, tests in dict.iteritems()) for filter in self.filters: tests = tests.filter(filter) return tests