evaluatePreconditions method Null safety

Future<Iterable<Precondition>> evaluatePreconditions(
  1. {bool ignoreCache = false}
)

Run evaluation of all preconditions registered in this repository. Run order respects dependencies but when possible, tests are evaluated in parallel.

In case the previous evaluation is still running, only the already finished tests are evaluated again. The registerPrecondition.satisfiedCache and registerPrecondition.notSatisfiedCache allow usage of previously obtained result of evaluation.

Implementation

Future<Iterable<Precondition>> evaluatePreconditions({bool ignoreCache: false}) async {
  _thisRunCache ??= _RunCache();
  var list = _known.values.toList();
  _log.info("Evaluating ${list.length} preconditions");
  try {
    _thisRunCache!.use();
    var results = list.map((p) => p._evaluate(ignoreCache: ignoreCache));
    notifyListeners();
    await Future.wait(results);
  } finally {
    _thisRunCache!.release();
  }
  notifyListeners();
  await _releaseRunCache();
  return List.unmodifiable(list);
}