defineReflectiveSuite function

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

    Run the define function parameter that calls defineReflectiveTests to add normal and "solo" tests, and also calls defineReflectiveSuite 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 defineReflectiveSuite(void Function() define, {String name = ''}) {
      String groupName = _currentSuiteName;
      _currentSuiteLevel++;
      try {
        _currentSuiteName = _combineNames(_currentSuiteName, name);
        define();
      } finally {
        _currentSuiteName = groupName;
        _currentSuiteLevel--;
      }
      _addTestsIfTopLevelSuite();
    }