testAggregateAnnotatedElements<T, R extends AggregateResults> function

void testAggregateAnnotatedElements<T, R extends AggregateResults>(
  1. LibraryReader libraryReader,
  2. AggregateGeneratorForAnnotation<T, R> defaultGenerator, {
  3. Map<String, AggregateGeneratorForAnnotation<T, R>>? additionalGenerators,
  4. Iterable<String>? expectedAnnotatedTests,
  5. Iterable<String>? defaultConfiguration,
})

If defaultConfiguration is not provided or null, "default" and the keys from additionalGenerators (if provided) are used.

Tests registered by this function assume initializeBuildLogTracking has been called.

If expectedAnnotatedTests is provided, it should contain the names of the members in libraryReader that are annotated for testing. If the same element is annotated for multiple tests, it should appear in the list the same number of times.

Implementation

void testAggregateAnnotatedElements<T, R extends AggregateResults>(
  LibraryReader libraryReader,
  AggregateGeneratorForAnnotation<T, R> defaultGenerator, {
  Map<String, AggregateGeneratorForAnnotation<T, R>>? additionalGenerators,
  Iterable<String>? expectedAnnotatedTests,
  Iterable<String>? defaultConfiguration,
}) {
  for (final entry in getAggregateAnnotatedClasses<T, R>(
    libraryReader,
    defaultGenerator,
    additionalGenerators: additionalGenerators,
    expectedAnnotatedTests: expectedAnnotatedTests,
    defaultConfiguration: defaultConfiguration,
  )) {
    entry._registerTest();
  }
}