diff --git a/tools/test.dart b/tools/test.dart index 21e1150d0a7..bbfdf258cfe 100755 --- a/tools/test.dart +++ b/tools/test.dart @@ -30,287 +30,13 @@ library test; import "dart:async"; import "dart:io"; -import "dart:math" as math; -import "testing/dart/browser_controller.dart"; -import "testing/dart/http_server.dart"; +import "testing/dart/test_configurations.dart"; import "testing/dart/test_options.dart"; import "testing/dart/test_progress.dart"; -import "testing/dart/test_runner.dart"; import "testing/dart/test_suite.dart"; import "testing/dart/utils.dart"; -import "testing/dart/vm_test_config.dart"; -import "testing/dart/co19_test_config.dart"; - -/** - * The directories that contain test suites which follow the conventions - * required by [StandardTestSuite]'s forDirectory constructor. - * New test suites should follow this convention because it makes it much - * simpler to add them to test.dart. Existing test suites should be - * moved to here, if possible. -*/ -final TEST_SUITE_DIRECTORIES = [ - new Path('pkg'), - new Path('runtime/tests/vm'), - new Path('runtime/bin/vmservice'), - new Path('samples'), - new Path('samples-dev'), - new Path('tests/benchmark_smoke'), - new Path('tests/chrome'), - new Path('tests/compiler/dart2js'), - new Path('tests/compiler/dart2js_extra'), - new Path('tests/compiler/dart2js_native'), - new Path('tests/corelib'), - new Path('tests/html'), - new Path('tests/isolate'), - new Path('tests/language'), - new Path('tests/lib'), - new Path('tests/standalone'), - new Path('tests/try'), - new Path('tests/utils'), - new Path('utils/tests/css'), - new Path('utils/tests/peg'), -]; - -void testConfigurations(List configurations) { - var startTime = new DateTime.now(); - // Extract global options from first configuration. - var firstConf = configurations[0]; - var maxProcesses = firstConf['tasks']; - var progressIndicator = firstConf['progress']; - // TODO(kustermann): Remove this option once the buildbots don't use it - // anymore. - var failureSummary = firstConf['failure-summary']; - BuildbotProgressIndicator.stepName = firstConf['step_name']; - var verbose = firstConf['verbose']; - var printTiming = firstConf['time']; - var listTests = firstConf['list']; - - var recordingPath = firstConf['record_to_file']; - var recordingOutputPath = firstConf['replay_from_file']; - - Browser.deleteCache = firstConf['clear_browser_cache']; - - if (recordingPath != null && recordingOutputPath != null) { - print("Fatal: Can't have the '--record_to_file' and '--replay_from_file'" - "at the same time. Exiting ..."); - exit(1); - } - - if (!firstConf['append_logs']) { - var files = [new File(TestUtils.flakyFileName()), - new File(TestUtils.testOutcomeFileName())]; - for (var file in files) { - if (file.existsSync()) { - file.deleteSync(); - } - } - } - - DebugLogger.init(firstConf['write_debug_log'] ? - TestUtils.debugLogfile() : null, append: firstConf['append_logs']); - - // Print the configurations being run by this execution of - // test.dart. However, don't do it if the silent progress indicator - // is used. This is only needed because of the junit tests. - if (progressIndicator != 'silent') { - List output_words = configurations.length > 1 ? - ['Test configurations:'] : ['Test configuration:']; - for (Map conf in configurations) { - List settings = ['compiler', 'runtime', 'mode', 'arch'] - .map((name) => conf[name]).toList(); - if (conf['checked']) settings.add('checked'); - output_words.add(settings.join('_')); - } - print(output_words.join(' ')); - } - - var runningBrowserTests = configurations.any((config) { - return TestUtils.isBrowserRuntime(config['runtime']); - }); - - List serverFutures = []; - var testSuites = new List(); - var maxBrowserProcesses = maxProcesses; - if (configurations.length > 1 && - (configurations[0]['test_server_port'] != 0 || - configurations[0]['test_server_cross_origin_port'] != 0)) { - print("If the http server ports are specified, only one configuration" - " may be run at a time"); - exit(1); - } - for (var conf in configurations) { - Map selectors = conf['selectors']; - var useContentSecurityPolicy = conf['csp']; - if (!listTests && runningBrowserTests) { - // Start global http servers that serve the entire dart repo. - // The http server is available on window.location.port, and a second - // server for cross-domain tests can be found by calling - // getCrossOriginPortNumber(). - var servers = new TestingServers(new Path(TestUtils.buildDir(conf)), - useContentSecurityPolicy, - conf['runtime'], - null, - conf['package_root']); - serverFutures.add(servers.startServers(conf['local_ip'], - port: conf['test_server_port'], - crossOriginPort: conf['test_server_cross_origin_port'])); - conf['_servers_'] = servers; - if (verbose) { - serverFutures.last.then((_) { - var commandline = servers.httpServerCommandline(); - print('Started HttpServers: $commandline'); - }); - } - } - - if (conf['runtime'].startsWith('ie')) { - // NOTE: We've experienced random timeouts of tests on ie9/ie10. The - // underlying issue has not been determined yet. Our current hypothesis - // is that windows does not handle the IE processes independently. - // If we have more than one browser and kill a browser we are seeing - // issues with starting up a new browser just after killing the hanging - // browser. - maxBrowserProcesses = 1; - } else if (conf['runtime'].startsWith('safari')) { - // Safari does not allow us to run from a fresh profile, so we can only - // use one browser. Additionally, you can not start two simulators - // for mobile safari simultainiously. - maxBrowserProcesses = 1; - } else if (conf['runtime'] == 'chrome' && - Platform.operatingSystem == 'macos') { - // Chrome on mac results in random timeouts. - maxBrowserProcesses = math.max(1, maxBrowserProcesses ~/ 2); - } - - // If we specifically pass in a suite only run that. - if (conf['suite_dir'] != null) { - var suite_path = new Path(conf['suite_dir']); - testSuites.add(new PKGTestSuite(conf, suite_path)); - } else { - for (String key in selectors.keys) { - if (key == 'co19') { - testSuites.add(new Co19TestSuite(conf)); - } else if (conf['compiler'] == 'none' && - conf['runtime'] == 'vm' && - key == 'vm') { - // vm tests contain both cc tests (added here) and dart tests (added - // in [TEST_SUITE_DIRECTORIES]). - testSuites.add(new VMTestSuite(conf)); - } else if (conf['analyzer']) { - if (key == 'analyze_library') { - testSuites.add(new AnalyzeLibraryTestSuite(conf)); - } - } else if (conf['compiler'] == 'none' && - conf['runtime'] == 'vm' && - key == 'pkgbuild') { - if (!conf['use_repository_packages'] && - !conf['use_public_packages']) { - print("You need to use either --use-repository-packages or " - "--use-public-packages with the pkgbuild test suite!"); - exit(1); - } - if (!conf['use_sdk']) { - print("Running the 'pkgbuild' test suite requires " - "passing the '--use-sdk' to test.py"); - exit(1); - } - testSuites.add( - new PkgBuildTestSuite(conf, 'pkgbuild', 'pkg/pkgbuild.status')); - } else if (key == 'pub') { - // TODO(rnystrom): Move pub back into TEST_SUITE_DIRECTORIES once - // #104 is fixed. - testSuites.add(new StandardTestSuite(conf, 'pub', - new Path('sdk/lib/_internal/pub_generated'), - ['sdk/lib/_internal/pub/pub.status'], - isTestFilePredicate: (file) => file.endsWith('_test.dart'), - recursive: true)); - } - } - - for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { - final name = testSuiteDir.filename; - if (selectors.containsKey(name)) { - testSuites.add( - new StandardTestSuite.forDirectory(conf, testSuiteDir)); - } - } - } - } - - void allTestsFinished() { - for (var conf in configurations) { - if (conf.containsKey('_servers_')) { - conf['_servers_'].stopServers(); - } - } - DebugLogger.close(); - } - - var eventListener = []; - if (progressIndicator != 'silent') { - var printFailures = true; - var formatter = new Formatter(); - if (progressIndicator == 'color') { - progressIndicator = 'compact'; - formatter = new ColorFormatter(); - } - if (progressIndicator == 'diff') { - progressIndicator = 'compact'; - formatter = new ColorFormatter(); - printFailures = false; - eventListener.add(new StatusFileUpdatePrinter()); - } - eventListener.add(new SummaryPrinter()); - eventListener.add(new FlakyLogWriter()); - if (printFailures) { - // The buildbot has it's own failure summary since it needs to wrap it - // into '@@@'-annotated sections. - var printFailureSummary = progressIndicator != 'buildbot'; - eventListener.add(new TestFailurePrinter(printFailureSummary, formatter)); - } - eventListener.add(progressIndicatorFromName(progressIndicator, - startTime, - formatter)); - if (printTiming) { - eventListener.add(new TimingPrinter(startTime)); - } - eventListener.add(new SkippedCompilationsPrinter()); - eventListener.add(new LeftOverTempDirPrinter()); - } - if (firstConf['write_test_outcome_log']) { - eventListener.add(new TestOutcomeLogWriter()); - } - if (firstConf['copy_coredumps']) { - eventListener.add(new UnexpectedCrashDumpArchiver()); - } - - eventListener.add(new ExitCodeSetter()); - - void startProcessQueue() { - // [firstConf] is needed here, since the ProcessQueue needs to know the - // settings of 'noBatch' and 'local_ip' - new ProcessQueue(firstConf, - maxProcesses, - maxBrowserProcesses, - startTime, - testSuites, - eventListener, - allTestsFinished, - verbose, - recordingPath, - recordingOutputPath); - } - - // Start all the HTTP servers required before starting the process queue. - if (serverFutures.isEmpty) { - startProcessQueue(); - } else { - Future.wait(serverFutures).then((_) => startProcessQueue()); - } -} - -Future deleteTemporaryDartDirectories() { +Future _deleteTemporaryDartDirectories() { var completer = new Completer(); var environment = Platform.environment; if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') { @@ -331,7 +57,7 @@ Future deleteTemporaryDartDirectories() { void main(List arguments) { // This script is in [dart]/tools. TestUtils.setDartDirUri(Platform.script.resolve('..')); - deleteTemporaryDartDirectories().then((_) { + _deleteTemporaryDartDirectories().then((_) { var optionsParser = new TestOptionsParser(); var configurations = optionsParser.parse(arguments); if (configurations != null && configurations.length > 0) { @@ -339,4 +65,3 @@ void main(List arguments) { } }); } - diff --git a/tools/testing/dart/android.dart b/tools/testing/dart/android.dart index 54d56baf56b..d514bd62ee5 100644 --- a/tools/testing/dart/android.dart +++ b/tools/testing/dart/android.dart @@ -9,6 +9,7 @@ import "dart:convert" show LineSplitter, UTF8; import "dart:core"; import "dart:io"; +import "path.dart"; import "utils.dart"; Future _executeCommand(String executable, diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart index 661104deea7..01c5aec7c6f 100644 --- a/tools/testing/dart/browser_controller.dart +++ b/tools/testing/dart/browser_controller.dart @@ -10,6 +10,7 @@ import "dart:io"; import 'android.dart'; import 'http_server.dart'; +import 'path.dart'; import 'utils.dart'; class BrowserOutput { diff --git a/tools/testing/dart/browser_test.dart b/tools/testing/dart/browser_test.dart index 5e6be19d6a1..63d8de05e7a 100644 --- a/tools/testing/dart/browser_test.dart +++ b/tools/testing/dart/browser_test.dart @@ -2,7 +2,9 @@ // 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. -part of test_suite; +library browser_test; + +import 'path.dart'; String getHtmlContents(String title, String scriptType, diff --git a/tools/testing/dart/co19_test.dart b/tools/testing/dart/co19_test.dart index 48558fbb20f..ad05dca70f3 100644 --- a/tools/testing/dart/co19_test.dart +++ b/tools/testing/dart/co19_test.dart @@ -20,7 +20,7 @@ import "dart:io"; import "test_options.dart"; import "test_suite.dart"; -import "../../test.dart" as test_dart; +import "test_configurations.dart"; const List COMMON_ARGUMENTS = const ['--report', '--progress=diff', 'co19']; @@ -55,7 +55,7 @@ void main(List args) { } if (configurations != null || configurations.length > 0) { - test_dart.testConfigurations(configurations); + testConfigurations(configurations); } } diff --git a/tools/testing/dart/co19_test_config.dart b/tools/testing/dart/co19_test_config.dart index 57214eb31ba..e8d6492b5c4 100644 --- a/tools/testing/dart/co19_test_config.dart +++ b/tools/testing/dart/co19_test_config.dart @@ -4,8 +4,8 @@ library co19_test_config; +import 'path.dart'; import 'test_suite.dart'; -import 'utils.dart' show Path; class Co19TestSuite extends StandardTestSuite { RegExp _testRegExp = new RegExp(r"t[0-9]{2}.dart$"); diff --git a/tools/testing/dart/html_test.dart b/tools/testing/dart/html_test.dart index 9808cfb189f..0f69eed460f 100644 --- a/tools/testing/dart/html_test.dart +++ b/tools/testing/dart/html_test.dart @@ -14,6 +14,7 @@ library html_test; import "dart:convert"; import "dart:io"; +import "path.dart"; import "test_suite.dart"; import "utils.dart"; diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart index 4e04773ec73..7f5fae75bc4 100644 --- a/tools/testing/dart/http_server.dart +++ b/tools/testing/dart/http_server.dart @@ -10,6 +10,7 @@ import 'dart:io'; import 'dart:convert' show HtmlEscape; +import 'path.dart'; import 'test_suite.dart'; // For TestUtils. // TODO(efortuna): Rewrite to not use the args library and simply take an // expected number of arguments, so test.dart doesn't rely on the args library? diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart index 0cc35c21fd4..3aed790d6fc 100644 --- a/tools/testing/dart/multitest.dart +++ b/tools/testing/dart/multitest.dart @@ -6,6 +6,8 @@ library multitest; import "dart:async"; import "dart:io"; + +import "path.dart"; import "test_suite.dart"; import "utils.dart"; diff --git a/tools/testing/dart/legacy_path.dart b/tools/testing/dart/path.dart similarity index 99% rename from tools/testing/dart/legacy_path.dart rename to tools/testing/dart/path.dart index 57a4ac70135..9ccd5462e0a 100644 --- a/tools/testing/dart/legacy_path.dart +++ b/tools/testing/dart/path.dart @@ -2,7 +2,10 @@ // 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. -part of utils; +library path; + +import 'dart:io'; +import 'dart:math'; class Path { final String _path; diff --git a/tools/testing/dart/record_and_replay.dart b/tools/testing/dart/record_and_replay.dart index 5abb41c07c2..68e67ce4e40 100644 --- a/tools/testing/dart/record_and_replay.dart +++ b/tools/testing/dart/record_and_replay.dart @@ -7,8 +7,8 @@ library record_and_replay; import 'dart:io'; import 'dart:convert'; +import 'path.dart'; import 'test_runner.dart'; -import 'utils.dart' show Path; /* * Json files look like this: diff --git a/tools/testing/dart/status_file_parser.dart b/tools/testing/dart/status_file_parser.dart index f728636386c..20b57c7d06e 100644 --- a/tools/testing/dart/status_file_parser.dart +++ b/tools/testing/dart/status_file_parser.dart @@ -8,8 +8,8 @@ import "dart:async"; import "dart:convert" show LineSplitter, UTF8; import "dart:io"; +import "path.dart"; import "status_expression.dart"; -import "utils.dart" show Path; class Expectation { // Possible outcomes of running a test. diff --git a/tools/testing/dart/test_configurations.dart b/tools/testing/dart/test_configurations.dart new file mode 100644 index 00000000000..63d7f1d2842 --- /dev/null +++ b/tools/testing/dart/test_configurations.dart @@ -0,0 +1,287 @@ +// Copyright (c) 2012, 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. + +library test_configurations; + +import "dart:async"; +import 'dart:io'; +import "dart:math" as math; + +import "browser_controller.dart"; +import "co19_test_config.dart"; +import "http_server.dart"; +import "path.dart"; +import "test_progress.dart"; +import "test_runner.dart"; +import "test_suite.dart"; +import "utils.dart"; +import "vm_test_config.dart"; + +/** + * The directories that contain test suites which follow the conventions + * required by [StandardTestSuite]'s forDirectory constructor. + * New test suites should follow this convention because it makes it much + * simpler to add them to test.dart. Existing test suites should be + * moved to here, if possible. +*/ +final TEST_SUITE_DIRECTORIES = [ + new Path('pkg'), + new Path('runtime/tests/vm'), + new Path('runtime/bin/vmservice'), + new Path('samples'), + new Path('samples-dev'), + new Path('tests/benchmark_smoke'), + new Path('tests/chrome'), + new Path('tests/compiler/dart2js'), + new Path('tests/compiler/dart2js_extra'), + new Path('tests/compiler/dart2js_native'), + new Path('tests/corelib'), + new Path('tests/html'), + new Path('tests/isolate'), + new Path('tests/language'), + new Path('tests/lib'), + new Path('tests/standalone'), + new Path('tests/try'), + new Path('tests/utils'), + new Path('utils/tests/css'), + new Path('utils/tests/peg'), +]; + +void testConfigurations(List configurations) { + var startTime = new DateTime.now(); + // Extract global options from first configuration. + var firstConf = configurations[0]; + var maxProcesses = firstConf['tasks']; + var progressIndicator = firstConf['progress']; + // TODO(kustermann): Remove this option once the buildbots don't use it + // anymore. + var failureSummary = firstConf['failure-summary']; + BuildbotProgressIndicator.stepName = firstConf['step_name']; + var verbose = firstConf['verbose']; + var printTiming = firstConf['time']; + var listTests = firstConf['list']; + + var recordingPath = firstConf['record_to_file']; + var recordingOutputPath = firstConf['replay_from_file']; + + Browser.deleteCache = firstConf['clear_browser_cache']; + + if (recordingPath != null && recordingOutputPath != null) { + print("Fatal: Can't have the '--record_to_file' and '--replay_from_file'" + "at the same time. Exiting ..."); + exit(1); + } + + if (!firstConf['append_logs']) { + var files = [new File(TestUtils.flakyFileName()), + new File(TestUtils.testOutcomeFileName())]; + for (var file in files) { + if (file.existsSync()) { + file.deleteSync(); + } + } + } + + DebugLogger.init(firstConf['write_debug_log'] ? + TestUtils.debugLogfile() : null, append: firstConf['append_logs']); + + // Print the configurations being run by this execution of + // test.dart. However, don't do it if the silent progress indicator + // is used. This is only needed because of the junit tests. + if (progressIndicator != 'silent') { + List output_words = configurations.length > 1 ? + ['Test configurations:'] : ['Test configuration:']; + for (Map conf in configurations) { + List settings = ['compiler', 'runtime', 'mode', 'arch'] + .map((name) => conf[name]).toList(); + if (conf['checked']) settings.add('checked'); + output_words.add(settings.join('_')); + } + print(output_words.join(' ')); + } + + var runningBrowserTests = configurations.any((config) { + return TestUtils.isBrowserRuntime(config['runtime']); + }); + + List serverFutures = []; + var testSuites = new List(); + var maxBrowserProcesses = maxProcesses; + if (configurations.length > 1 && + (configurations[0]['test_server_port'] != 0 || + configurations[0]['test_server_cross_origin_port'] != 0)) { + print("If the http server ports are specified, only one configuration" + " may be run at a time"); + exit(1); + } + for (var conf in configurations) { + Map selectors = conf['selectors']; + var useContentSecurityPolicy = conf['csp']; + if (!listTests && runningBrowserTests) { + // Start global http servers that serve the entire dart repo. + // The http server is available on window.location.port, and a second + // server for cross-domain tests can be found by calling + // getCrossOriginPortNumber(). + var servers = new TestingServers(new Path(TestUtils.buildDir(conf)), + useContentSecurityPolicy, + conf['runtime'], + null, + conf['package_root']); + serverFutures.add(servers.startServers(conf['local_ip'], + port: conf['test_server_port'], + crossOriginPort: conf['test_server_cross_origin_port'])); + conf['_servers_'] = servers; + if (verbose) { + serverFutures.last.then((_) { + var commandline = servers.httpServerCommandline(); + print('Started HttpServers: $commandline'); + }); + } + } + + if (conf['runtime'].startsWith('ie')) { + // NOTE: We've experienced random timeouts of tests on ie9/ie10. The + // underlying issue has not been determined yet. Our current hypothesis + // is that windows does not handle the IE processes independently. + // If we have more than one browser and kill a browser we are seeing + // issues with starting up a new browser just after killing the hanging + // browser. + maxBrowserProcesses = 1; + } else if (conf['runtime'].startsWith('safari')) { + // Safari does not allow us to run from a fresh profile, so we can only + // use one browser. Additionally, you can not start two simulators + // for mobile safari simultainiously. + maxBrowserProcesses = 1; + } else if (conf['runtime'] == 'chrome' && + Platform.operatingSystem == 'macos') { + // Chrome on mac results in random timeouts. + maxBrowserProcesses = math.max(1, maxBrowserProcesses ~/ 2); + } + + // If we specifically pass in a suite only run that. + if (conf['suite_dir'] != null) { + var suite_path = new Path(conf['suite_dir']); + testSuites.add(new PKGTestSuite(conf, suite_path)); + } else { + for (String key in selectors.keys) { + if (key == 'co19') { + testSuites.add(new Co19TestSuite(conf)); + } else if (conf['compiler'] == 'none' && + conf['runtime'] == 'vm' && + key == 'vm') { + // vm tests contain both cc tests (added here) and dart tests (added + // in [TEST_SUITE_DIRECTORIES]). + testSuites.add(new VMTestSuite(conf)); + } else if (conf['analyzer']) { + if (key == 'analyze_library') { + testSuites.add(new AnalyzeLibraryTestSuite(conf)); + } + } else if (conf['compiler'] == 'none' && + conf['runtime'] == 'vm' && + key == 'pkgbuild') { + if (!conf['use_repository_packages'] && + !conf['use_public_packages']) { + print("You need to use either --use-repository-packages or " + "--use-public-packages with the pkgbuild test suite!"); + exit(1); + } + if (!conf['use_sdk']) { + print("Running the 'pkgbuild' test suite requires " + "passing the '--use-sdk' to test.py"); + exit(1); + } + testSuites.add( + new PkgBuildTestSuite(conf, 'pkgbuild', 'pkg/pkgbuild.status')); + } else if (key == 'pub') { + // TODO(rnystrom): Move pub back into TEST_SUITE_DIRECTORIES once + // #104 is fixed. + testSuites.add(new StandardTestSuite(conf, 'pub', + new Path('sdk/lib/_internal/pub_generated'), + ['sdk/lib/_internal/pub/pub.status'], + isTestFilePredicate: (file) => file.endsWith('_test.dart'), + recursive: true)); + } + } + + for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { + final name = testSuiteDir.filename; + if (selectors.containsKey(name)) { + testSuites.add( + new StandardTestSuite.forDirectory(conf, testSuiteDir)); + } + } + } + } + + void allTestsFinished() { + for (var conf in configurations) { + if (conf.containsKey('_servers_')) { + conf['_servers_'].stopServers(); + } + } + DebugLogger.close(); + } + + var eventListener = []; + if (progressIndicator != 'silent') { + var printFailures = true; + var formatter = new Formatter(); + if (progressIndicator == 'color') { + progressIndicator = 'compact'; + formatter = new ColorFormatter(); + } + if (progressIndicator == 'diff') { + progressIndicator = 'compact'; + formatter = new ColorFormatter(); + printFailures = false; + eventListener.add(new StatusFileUpdatePrinter()); + } + eventListener.add(new SummaryPrinter()); + eventListener.add(new FlakyLogWriter()); + if (printFailures) { + // The buildbot has it's own failure summary since it needs to wrap it + // into '@@@'-annotated sections. + var printFailureSummary = progressIndicator != 'buildbot'; + eventListener.add(new TestFailurePrinter(printFailureSummary, formatter)); + } + eventListener.add(progressIndicatorFromName(progressIndicator, + startTime, + formatter)); + if (printTiming) { + eventListener.add(new TimingPrinter(startTime)); + } + eventListener.add(new SkippedCompilationsPrinter()); + eventListener.add(new LeftOverTempDirPrinter()); + } + if (firstConf['write_test_outcome_log']) { + eventListener.add(new TestOutcomeLogWriter()); + } + if (firstConf['copy_coredumps']) { + eventListener.add(new UnexpectedCrashDumpArchiver()); + } + + eventListener.add(new ExitCodeSetter()); + + void startProcessQueue() { + // [firstConf] is needed here, since the ProcessQueue needs to know the + // settings of 'noBatch' and 'local_ip' + new ProcessQueue(firstConf, + maxProcesses, + maxBrowserProcesses, + startTime, + testSuites, + eventListener, + allTestsFinished, + verbose, + recordingPath, + recordingOutputPath); + } + + // Start all the HTTP servers required before starting the process queue. + if (serverFutures.isEmpty) { + startProcessQueue(); + } else { + Future.wait(serverFutures).then((_) => startProcessQueue()); + } +} diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart index c00e12478cc..940c5cc8cf2 100644 --- a/tools/testing/dart/test_options.dart +++ b/tools/testing/dart/test_options.dart @@ -7,7 +7,7 @@ library test_options_parser; import "dart:io"; import "drt_updater.dart"; import "test_suite.dart"; -import "utils.dart"; +import "path.dart"; import "compiler_configuration.dart" show CompilerConfiguration; import "runtime_configuration.dart" show RuntimeConfiguration; diff --git a/tools/testing/dart/test_progress.dart b/tools/testing/dart/test_progress.dart index 1105c362e90..bb31d29f692 100644 --- a/tools/testing/dart/test_progress.dart +++ b/tools/testing/dart/test_progress.dart @@ -8,6 +8,7 @@ import "dart:async"; import "dart:io"; import "dart:io" as io; import "dart:convert" show JSON; +import "path.dart"; import "status_file_parser.dart"; import "test_runner.dart"; import "test_suite.dart"; diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart index 30c4a861e79..e1652ff89e3 100644 --- a/tools/testing/dart/test_runner.dart +++ b/tools/testing/dart/test_runner.dart @@ -20,6 +20,7 @@ import "dart:io" as io; import "dart:math" as math; import 'dependency_graph.dart' as dgraph; import "browser_controller.dart"; +import "path.dart"; import "status_file_parser.dart"; import "test_progress.dart"; import "test_suite.dart"; diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart index 703e685fca5..cb136552459 100644 --- a/tools/testing/dart/test_suite.dart +++ b/tools/testing/dart/test_suite.dart @@ -18,6 +18,7 @@ import "dart:async"; import "dart:io"; import "drt_updater.dart"; import "html_test.dart" as htmlTest; +import "path.dart"; import "multitest.dart"; import "status_file_parser.dart"; import "test_runner.dart"; @@ -31,7 +32,7 @@ import "compiler_configuration.dart" show import "runtime_configuration.dart" show RuntimeConfiguration; -part "browser_test.dart"; +import 'browser_test.dart'; RegExp multiHtmlTestGroupRegExp = new RegExp(r"\s*[^/]\s*group\('[^,']*"); diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart index 5b242341639..a1c4ecc5b55 100644 --- a/tools/testing/dart/utils.dart +++ b/tools/testing/dart/utils.dart @@ -5,10 +5,9 @@ library utils; import 'dart:io'; -import 'dart:math' show min; import 'dart:convert'; -part 'legacy_path.dart'; +import 'path.dart'; // This is the maximum time we expect stdout/stderr of subprocesses to deliver // data after we've got the exitCode.