@@ -679,10 +679,87 @@ compiler.''',
679679 var progress = Progress .find (data["progress" ] as String );
680680 var nnbdMode = NnbdMode .find (data["nnbd" ] as String );
681681
682+ void addConfiguration (Configuration innerConfiguration,
683+ [String namedConfiguration]) {
684+ var configuration = TestConfiguration (
685+ configuration: innerConfiguration,
686+ progress: progress,
687+ selectors: selectors,
688+ testList: data["test_list_contents" ] as List <String >,
689+ repeat: data["repeat" ] as int ,
690+ batch: ! (data["noBatch" ] as bool ),
691+ batchDart2JS: data["dart2js_batch" ] as bool ,
692+ copyCoreDumps: data["copy_coredumps" ] as bool ,
693+ isVerbose: data["verbose" ] as bool ,
694+ listTests: data["list" ] as bool ,
695+ listStatusFiles: data["list_status_files" ] as bool ,
696+ cleanExit: data["clean_exit" ] as bool ,
697+ silentFailures: data["silent_failures" ] as bool ,
698+ printTiming: data["time" ] as bool ,
699+ printReport: data["report" ] as bool ,
700+ reportInJson: data["report_in_json" ] as bool ,
701+ resetBrowser: data["reset_browser_configuration" ] as bool ,
702+ skipCompilation: data["skip_compilation" ] as bool ,
703+ writeDebugLog: data["write_debug_log" ] as bool ,
704+ writeResults: data["write_results" ] as bool ,
705+ writeLogs: data["write_logs" ] as bool ,
706+ drtPath: data["drt" ] as String ,
707+ chromePath: data["chrome" ] as String ,
708+ safariPath: data["safari" ] as String ,
709+ firefoxPath: data["firefox" ] as String ,
710+ dartPath: data["dart" ] as String ,
711+ dartPrecompiledPath: data["dart_precompiled" ] as String ,
712+ genSnapshotPath: data["gen-snapshot" ] as String ,
713+ keepGeneratedFiles: data["keep_generated_files" ] as bool ,
714+ taskCount: data["tasks" ] as int ,
715+ shardCount: data["shards" ] as int ,
716+ shard: data["shard" ] as int ,
717+ stepName: data["step_name" ] as String ,
718+ testServerPort: data["test_server_port" ] as int ,
719+ testServerCrossOriginPort:
720+ data['test_server_cross_origin_port' ] as int ,
721+ testDriverErrorPort: data["test_driver_error_port" ] as int ,
722+ localIP: data["local_ip" ] as String ,
723+ sharedOptions: sharedOptions,
724+ packages: data["packages" ] as String ,
725+ packageRoot: data["package_root" ] as String ,
726+ suiteDirectory: data["suite_dir" ] as String ,
727+ outputDirectory: data["output_directory" ] as String ,
728+ reproducingArguments:
729+ _reproducingCommand (data, namedConfiguration != null ),
730+ fastTestsOnly: data["fast_tests" ] as bool ,
731+ printPassingStdout: data["print_passing_stdout" ] as bool );
732+
733+ if (configuration.validate ()) {
734+ result.add (configuration);
735+ }
736+ }
737+
738+ String namedConfigurationOption = data["named_configuration" ] as String ;
739+ if (namedConfigurationOption != null ) {
740+ List <String > namedConfigurations = namedConfigurationOption.split (',' );
741+ var testMatrixFile = "tools/bots/test_matrix.json" ;
742+ var testMatrix = TestMatrix .fromPath (testMatrixFile);
743+ for (String namedConfiguration in namedConfigurations) {
744+ var configuration = testMatrix.configurations.singleWhere (
745+ (c) => c.name == namedConfiguration,
746+ orElse: () => null );
747+ if (configuration == null ) {
748+ var names = testMatrix.configurations
749+ .map ((configuration) => configuration.name)
750+ .toList ();
751+ names.sort ();
752+ _fail ('The named configuration "$namedConfiguration " does not exist.'
753+ ' The following configurations are available:\n '
754+ ' * ${names .join ('\n * ' )}' );
755+ }
756+ addConfiguration (configuration);
757+ }
758+ return result;
759+ }
760+
682761 // Expand runtimes.
683762 for (var runtime in runtimes) {
684- // Start installing the runtime if needed.
685-
686763 // Expand architectures.
687764 var architectures = data["arch" ] as String ;
688765 if (architectures == "all" ) {
@@ -700,82 +777,28 @@ compiler.''',
700777 for (var modeName in modes.split ("," )) {
701778 var mode = Mode .find (modeName);
702779 var system = System .find (data["system" ] as String );
703- var namedConfiguration =
704- _namedConfiguration (data["named_configuration" ] as String );
705- var innerConfiguration = namedConfiguration ??
706- Configuration ("custom configuration" , architecture, compiler,
707- mode, runtime, system,
708- nnbdMode: nnbdMode,
709- timeout: data["timeout" ] as int ,
710- enableAsserts: data["enable_asserts" ] as bool ,
711- useAnalyzerCfe: data["use_cfe" ] as bool ,
712- useAnalyzerFastaParser:
713- data["analyzer_use_fasta_parser" ] as bool ,
714- useBlobs: data["use_blobs" ] as bool ,
715- useElf: data["use_elf" ] as bool ,
716- useSdk: data["use_sdk" ] as bool ,
717- useHotReload: data["hot_reload" ] as bool ,
718- useHotReloadRollback: data["hot_reload_rollback" ] as bool ,
719- isHostChecked: data["host_checked" ] as bool ,
720- isCsp: data["csp" ] as bool ,
721- isMinified: data["minified" ] as bool ,
722- vmOptions: vmOptions,
723- dart2jsOptions: dart2jsOptions,
724- experiments: experiments,
725- babel: data['babel' ] as String ,
726- builderTag: data["builder_tag" ] as String );
727- var configuration = TestConfiguration (
728- configuration: innerConfiguration,
729- progress: progress,
730- selectors: selectors,
731- testList: data["test_list_contents" ] as List <String >,
732- repeat: data["repeat" ] as int ,
733- batch: ! (data["noBatch" ] as bool ),
734- batchDart2JS: data["dart2js_batch" ] as bool ,
735- copyCoreDumps: data["copy_coredumps" ] as bool ,
736- isVerbose: data["verbose" ] as bool ,
737- listTests: data["list" ] as bool ,
738- listStatusFiles: data["list_status_files" ] as bool ,
739- cleanExit: data["clean_exit" ] as bool ,
740- silentFailures: data["silent_failures" ] as bool ,
741- printTiming: data["time" ] as bool ,
742- printReport: data["report" ] as bool ,
743- reportInJson: data["report_in_json" ] as bool ,
744- resetBrowser: data["reset_browser_configuration" ] as bool ,
745- skipCompilation: data["skip_compilation" ] as bool ,
746- writeDebugLog: data["write_debug_log" ] as bool ,
747- writeResults: data["write_results" ] as bool ,
748- writeLogs: data["write_logs" ] as bool ,
749- drtPath: data["drt" ] as String ,
750- chromePath: data["chrome" ] as String ,
751- safariPath: data["safari" ] as String ,
752- firefoxPath: data["firefox" ] as String ,
753- dartPath: data["dart" ] as String ,
754- dartPrecompiledPath: data["dart_precompiled" ] as String ,
755- genSnapshotPath: data["gen-snapshot" ] as String ,
756- keepGeneratedFiles: data["keep_generated_files" ] as bool ,
757- taskCount: data["tasks" ] as int ,
758- shardCount: data["shards" ] as int ,
759- shard: data["shard" ] as int ,
760- stepName: data["step_name" ] as String ,
761- testServerPort: data["test_server_port" ] as int ,
762- testServerCrossOriginPort:
763- data['test_server_cross_origin_port' ] as int ,
764- testDriverErrorPort: data["test_driver_error_port" ] as int ,
765- localIP: data["local_ip" ] as String ,
766- sharedOptions: sharedOptions,
767- packages: data["packages" ] as String ,
768- packageRoot: data["package_root" ] as String ,
769- suiteDirectory: data["suite_dir" ] as String ,
770- outputDirectory: data["output_directory" ] as String ,
771- reproducingArguments:
772- _reproducingCommand (data, namedConfiguration != null ),
773- fastTestsOnly: data["fast_tests" ] as bool ,
774- printPassingStdout: data["print_passing_stdout" ] as bool );
775-
776- if (configuration.validate ()) {
777- result.add (configuration);
778- }
780+ var configuration = Configuration ("custom configuration" ,
781+ architecture, compiler, mode, runtime, system,
782+ nnbdMode: nnbdMode,
783+ timeout: data["timeout" ] as int ,
784+ enableAsserts: data["enable_asserts" ] as bool ,
785+ useAnalyzerCfe: data["use_cfe" ] as bool ,
786+ useAnalyzerFastaParser:
787+ data["analyzer_use_fasta_parser" ] as bool ,
788+ useBlobs: data["use_blobs" ] as bool ,
789+ useElf: data["use_elf" ] as bool ,
790+ useSdk: data["use_sdk" ] as bool ,
791+ useHotReload: data["hot_reload" ] as bool ,
792+ useHotReloadRollback: data["hot_reload_rollback" ] as bool ,
793+ isHostChecked: data["host_checked" ] as bool ,
794+ isCsp: data["csp" ] as bool ,
795+ isMinified: data["minified" ] as bool ,
796+ vmOptions: vmOptions,
797+ dart2jsOptions: dart2jsOptions,
798+ experiments: experiments,
799+ babel: data['babel' ] as String ,
800+ builderTag: data["builder_tag" ] as String );
801+ addConfiguration (configuration);
779802 }
780803 }
781804 }
@@ -934,25 +957,6 @@ class OptionParseException implements Exception {
934957 OptionParseException (this .message);
935958}
936959
937- Configuration _namedConfiguration (String template) {
938- if (template == null ) return null ;
939-
940- var testMatrixFile = "tools/bots/test_matrix.json" ;
941- var testMatrix = TestMatrix .fromPath (testMatrixFile);
942- var configuration = testMatrix.configurations
943- .singleWhere ((c) => c.name == template, orElse: () => null );
944- if (configuration == null ) {
945- var names = testMatrix.configurations
946- .map ((configuration) => configuration.name)
947- .toList ();
948- names.sort ();
949- _fail ('The named configuration "$template " does not exist. The following '
950- 'configurations are available:\n * ${names .join ('\n * ' )}' );
951- }
952-
953- return configuration;
954- }
955-
956960/// Throws an [OptionParseException] with [message] .
957961void _fail (String message) {
958962 throw OptionParseException (message);
0 commit comments