| OLD | NEW |
| 1 #!/usr/bin/env dart_bin | 1 #!/usr/bin/env dart_bin |
| 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 | 19 |
| 19 // TODO(ager): This activity tracking is temporary until stdout is | 20 // TODO(ager): This activity tracking is temporary until stdout is |
| 20 // closed implicitly when nothing more can happen. | 21 // closed implicitly when nothing more can happen. |
| 21 int pendingActivities = 0; | 22 int pendingActivities = 0; |
| 22 | 23 |
| 23 void activityStarted() { | 24 void activityStarted() { |
| 24 ++pendingActivities; | 25 ++pendingActivities; |
| 25 } | 26 } |
| 26 | 27 |
| 27 void activityCompleted() { | 28 void activityCompleted() { |
| 28 --pendingActivities; | 29 --pendingActivities; |
| 29 } | 30 } |
| 30 | 31 |
| 31 void exitIfLastActivity() { | 32 void exitIfLastActivity() { |
| 32 if (pendingActivities == 1) { | 33 if (pendingActivities == 1) { |
| 33 stdout.write('\n'.charCodes()); | 34 stdout.write('\n'.charCodes()); |
| 34 stdout.close(); | 35 stdout.close(); |
| 35 } | 36 } |
| 36 } | 37 } |
| 37 | 38 |
| 38 main() { | 39 main() { |
| 39 var start_time = new Date.now(); | 40 var startTime = new Date.now(); |
| 40 var optionsParser = new TestOptionsParser(); | 41 var optionsParser = new TestOptionsParser(); |
| 41 var configurations = optionsParser.parse(new Options().arguments); | 42 var configurations = optionsParser.parse(new Options().arguments); |
| 42 if (configurations == null) return; | 43 if (configurations == null) return; |
| 43 activityStarted(); | 44 activityStarted(); |
| 44 // Extract global options from first configuration. | 45 // Extract global options from first configuration. |
| 45 var firstConf = configurations[0]; | 46 var firstConf = configurations[0]; |
| 46 var queue = new ProcessQueue(firstConf['tasks'], | 47 var queue = new ProcessQueue(firstConf['tasks'], |
| 47 firstConf['progress'], | 48 firstConf['progress'], |
| 48 start_time, | 49 startTime, |
| 49 exitIfLastActivity); | 50 exitIfLastActivity); |
| 50 for (var conf in configurations) { | 51 for (var conf in configurations) { |
| 51 activityStarted(); | 52 activityStarted(); |
| 53 new SamplesTestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 54 activityStarted(); |
| 52 new StandaloneTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 55 new StandaloneTestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 53 activityStarted(); | 56 activityStarted(); |
| 54 new CorelibTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 57 new CorelibTestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 55 activityStarted(); | 58 activityStarted(); |
| 56 new Co19TestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 59 new Co19TestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 57 activityStarted(); | 60 activityStarted(); |
| 58 new LanguageTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 61 new LanguageTestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 59 activityStarted(); | 62 activityStarted(); |
| 60 new IsolateTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 63 new IsolateTestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 61 activityStarted(); | 64 activityStarted(); |
| 62 new StubGeneratorTestSuite(conf).forEachTest(queue.runTest, activityComplete
d); | 65 new StubGeneratorTestSuite(conf).forEachTest(queue.runTest, activityComplete
d); |
| 63 if (conf["component"] == "vm") { | 66 if (conf["component"] == "vm") { |
| 64 activityStarted(); | 67 activityStarted(); |
| 65 new VMTestSuite(conf).forEachTest(queue.runTest, activityCompleted); | 68 new VMTestSuite(conf).forEachTest(queue.runTest, activityCompleted); |
| 66 } | 69 } |
| 67 } | 70 } |
| 68 } | 71 } |
| OLD | NEW |