run method

  1. @override
  2. @mustCallSuper
Future<AsserestReport> run()
inherited

The entire assertion task will be processed once run has been invoked.

This method MUST NOT be overridden and intent for callback only. For implementing assertion processor, please override runTestProcess instead.

Implementation

@override
@mustCallSuper
Future<AsserestReport> run() async {
  late AsserestResult result;
  final Stopwatch c = Stopwatch();
  if (_counter) {
    c.start();
  }

  try {
    result = await runTestProcess();
  } catch (_) {
    result = AsserestResult.error;
  } finally {
    if (c.isRunning) {
      c.stop();
    }
  }

  return _AsserestReport(
      property.url, property.accessible, result, _counter ? c.elapsed : null);
}