Skip to content

Commit

Permalink
Allow skipping of passes that miss a prerequisite (#17).
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Apr 30, 2020
1 parent f7558f3 commit 4e8ab58
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cvise/cvise.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,27 +134,28 @@ def reduce(self, pass_group, skip_initial=False):
@staticmethod
def _check_prerequisites(pass_group):
passes = set()
missing = set()

for category in pass_group:
for p in pass_group[category]:
if not p.check_prerequisites():
logging.error("Prereqs not found for pass {}".format(p))
missing.add(str(p))

if missing:
raise PrerequisitesNotFoundError(missing)

def _run_additional_passes(self, passes):
for p in passes:
self.test_manager.run_pass(p)
if not p.check_prerequisites():
logging.error("Skipping {}".format(p))
else:
self.test_manager.run_pass(p)

def _run_main_passes(self, passes):
while True:
total_file_size = self.test_manager.total_file_size

for p in passes:
self.test_manager.run_pass(p)
if not p.check_prerequisites():
logging.error("Skipping pass {}".format(p))
else:
self.test_manager.run_pass(p)

logging.info("Termination check: size was {}; now {}".format(total_file_size, self.test_manager.total_file_size))

Expand Down

0 comments on commit 4e8ab58

Please sign in to comment.