// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // @dart=2.9 import 'fasta.dart' as fasta; const List standardSuites = [ 'weak', 'outline', 'strong', 'text_serialization', 'textual_outline', ]; const List specialSuites = [ 'expression', 'incremental', ]; Future runStandardSuites([List args]) async { // Assert that 'strong' is the first suite - we use the assumption below. assert(standardSuites.first == 'weak', "Suite 'weak' most be the first."); bool first = true; for (String suite in standardSuites) { List tests = args == null ? [suite] : args.map((String arg) => '${suite}/$arg').toList(); await fasta.main([ 'testing', ...tests, // Only update comments in the first suite. Note that this only works // if the first compilation is a full compilation, i.e. not outline, // because comments are generated during body building and inference. if (first) '-DupdateComments=true', '-DupdateExpectations=true' ]); first = false; } } main(List args) async { if (args.isEmpty) { await runStandardSuites(); for (String suite in specialSuites) { await fasta.main(['testing', suite, '-DupdateExpectations=true']); } } else { List standardTests = []; for (String arg in args) { bool isSpecial = false; for (String suite in specialSuites) { if (arg.startsWith('$suite/')) { await fasta.main(['testing', arg, '-DupdateExpectations=true']); isSpecial = true; break; } } if (!isSpecial) { standardTests.add(arg); } } if (standardTests.isNotEmpty) { await runStandardSuites(args); } } }