Declarer constructor

Declarer({
  1. Metadata? metadata,
  2. Set<String>? platformVariables,
  3. bool collectTraces = false,
  4. bool noRetry = false,
  5. String? fullTestName,
  6. bool allowDuplicateTestNames = true,
  7. bool isStandalone = false,
})

Creates a new declarer for the root group.

This is the implicit group that exists outside of any calls to group(). If metadata is passed, it's used as the metadata for the implicit root group.

The platformVariables are the set of variables that are valid for platform selectors in test and group metadata, in addition to the built-in variables that are allowed everywhere.

If collectTraces is true, this will set GroupEntry.trace for all entries built by the declarer. Note that this can be noticeably slow when thousands of tests are being declared (see #457).

If noRetry is true tests will be run at most once.

If allowDuplicateTestNames is false, then a DuplicateTestNameException will be thrown if two tests (or groups) have the same name.

Implementation

Declarer({
  Metadata? metadata,
  Set<String>? platformVariables,
  bool collectTraces = false,
  bool noRetry = false,
  String? fullTestName,
  // TODO: Change the default https://github.com/dart-lang/test/issues/1571
  bool allowDuplicateTestNames = true,
  bool isStandalone = false,
}) : this._(
       null,
       null,
       metadata ?? Metadata(),
       platformVariables ?? const UnmodifiableSetView.empty(),
       collectTraces,
       null,
       null,
       noRetry,
       fullTestName,
       allowDuplicateTestNames ? null : <String>{},
       isStandalone,
     );