| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 #library("test"); | 6 #library("test"); |
| 7 | 7 |
| 8 #import("testing/dart/test_runner.dart"); | 8 #import("testing/dart/test_runner.dart"); |
| 9 #import("testing/dart/test_options.dart"); | 9 #import("testing/dart/test_options.dart"); |
| 10 | 10 |
| 11 #import("../tests/co19/test_config.dart"); | 11 #import("../tests/co19/test_config.dart"); |
| 12 #import("../tests/corelib/test_config.dart"); | 12 #import("../tests/corelib/test_config.dart"); |
| 13 #import("../tests/isolate/test_config.dart"); | 13 #import("../tests/isolate/test_config.dart"); |
| 14 #import("../tests/language/test_config.dart"); | 14 #import("../tests/language/test_config.dart"); |
| 15 #import("../tests/standalone/test_config.dart"); | 15 #import("../tests/standalone/test_config.dart"); |
| 16 #import("../tests/stub-generator/test_config.dart"); | 16 #import("../tests/stub-generator/test_config.dart"); |
| 17 #import("../runtime/tests/vm/test_config.dart"); | 17 #import("../runtime/tests/vm/test_config.dart"); |
| 18 #import("../samples/tests/samples/test_config.dart"); | 18 #import("../samples/tests/samples/test_config.dart"); |
| 19 | 19 |
| 20 // TODO(ager): This activity tracking is temporary until stdout is | |
| 21 // closed implicitly when nothing more can happen. | |
| 22 int pendingActivities = 0; | |
| 23 | |
| 24 void activityStarted() { | |
| 25 ++pendingActivities; | |
| 26 } | |
| 27 | |
| 28 void activityCompleted() { | |
| 29 --pendingActivities; | |
| 30 } | |
| 31 | |
| 32 void exitIfLastActivity() { | |
| 33 if (pendingActivities == 1) { | |
| 34 stdout.write('\n'.charCodes()); | |
| 35 stdout.close(); | |
| 36 } | |
| 37 } | |
| 38 | |
| 39 main() { | 20 main() { |
| 40 var startTime = new Date.now(); | 21 var startTime = new Date.now(); |
| 41 var optionsParser = new TestOptionsParser(); | 22 var optionsParser = new TestOptionsParser(); |
| 42 var configurations = optionsParser.parse(new Options().arguments); | 23 var configurations = optionsParser.parse(new Options().arguments); |
| 43 if (configurations == null) return; | 24 if (configurations == null) return; |
| 44 activityStarted(); | |
| 45 // Extract global options from first configuration. | 25 // Extract global options from first configuration. |
| 46 var firstConf = configurations[0]; | 26 var firstConf = configurations[0]; |
| 47 var queue = new ProcessQueue(firstConf['tasks'], | 27 var queue = new ProcessQueue(firstConf['tasks'], |
| 48 firstConf['progress'], | 28 firstConf['progress'], |
| 49 startTime, | 29 startTime); |
| 50 exitIfLastActivity); | |
| 51 for (var conf in configurations) { | 30 for (var conf in configurations) { |
| 52 activityStarted(); | 31 queue.addTestSuite(new SamplesTestSuite(conf)); |
| 53 new SamplesTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 32 queue.addTestSuite(new StandaloneTestSuite(conf)); |
| 54 activityStarted(); | 33 queue.addTestSuite(new CorelibTestSuite(conf)); |
| 55 new StandaloneTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 34 queue.addTestSuite(new Co19TestSuite(conf)); |
| 56 activityStarted(); | 35 queue.addTestSuite(new LanguageTestSuite(conf)); |
| 57 new CorelibTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 36 queue.addTestSuite(new IsolateTestSuite(conf)); |
| 58 activityStarted(); | 37 queue.addTestSuite(new StubGeneratorTestSuite(conf)); |
| 59 new Co19TestSuite(conf).forEachTest(queue.runTest, activityCompleted); | |
| 60 activityStarted(); | |
| 61 new LanguageTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | |
| 62 activityStarted(); | |
| 63 new IsolateTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | |
| 64 activityStarted(); | |
| 65 new StubGeneratorTestSuite(conf).forEachTest(queue.runTest, activityComplete
d); | |
| 66 if (conf["component"] == "vm") { | 38 if (conf["component"] == "vm") { |
| 67 activityStarted(); | 39 queue.addTestSuite(new VMTestSuite(conf)); |
| 68 new VMTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | |
| 69 } | 40 } |
| 70 } | 41 } |
| 71 } | 42 } |
| OLD | NEW |