defineAutoSuite function

void defineAutoSuite(
  1. void define(), {
  2. String name = '',
})

Run the define function parameter that calls defineAutoSuite to add normal and "solo" tests, and also calls defineAutoSuite to create embedded suites. If the current suite is the top-level one, perform check for "solo" groups and tests, and run all or only "solo" items.

Implementation

void defineAutoSuite(void Function() define, {String name = ''}) {
  String groupName = _currentSuiteName;
  _currentSuiteLevel++;
  try {
    _currentSuiteName = _combineNames(_currentSuiteName, name);
    define();
  } finally {
    _currentSuiteName = groupName;
    _currentSuiteLevel--;
  }
  _addTestsIfTopLevelSuite();
}