OLD | NEW |
| (Empty) |
1 #!/usr/bin/env dart | |
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
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. | |
5 | |
6 #library("test"); | |
7 | |
8 #import("testing/dart/test_runner.dart"); | |
9 #import("testing/dart/test_options.dart"); | |
10 | |
11 // This file is identical to test.dart with suites in frog and utils removed. | |
12 #import("../tests/co19/test_config.dart"); | |
13 #import("../tests/corelib/test_config.dart"); | |
14 #import("../tests/isolate/test_config.dart"); | |
15 #import("../tests/language/test_config.dart"); | |
16 #import("../tests/standalone/test_config.dart"); | |
17 #import("../tests/utils/test_config.dart"); | |
18 #import("../runtime/tests/vm/test_config.dart"); | |
19 #import("../samples/tests/samples/test_config.dart"); | |
20 #import("../client/tests/dartc/test_config.dart"); | |
21 #import("../compiler/tests/dartc/test_config.dart"); | |
22 #import("../client/tests/client/test_config.dart"); | |
23 | |
24 main() { | |
25 var startTime = new Date.now(); | |
26 var optionsParser = new TestOptionsParser(); | |
27 List<Map> configurations = optionsParser.parse(new Options().arguments); | |
28 if (configurations == null) return; | |
29 | |
30 // Extract global options from first configuration. | |
31 var firstConf = configurations[0]; | |
32 Map<String, RegExp> selectors = firstConf['selectors']; | |
33 var maxProcesses = firstConf['tasks']; | |
34 var progressIndicator = firstConf['progress']; | |
35 var verbose = firstConf['verbose']; | |
36 var printTiming = firstConf['time']; | |
37 var listTests = firstConf['list']; | |
38 var keepGeneratedTests = firstConf['keep-generated-tests']; | |
39 | |
40 // Print the configurations being run by this execution of | |
41 // test.dart. However, don't do it if the silent progress indicator | |
42 // is used. This is only needed because of the junit tests. | |
43 if (progressIndicator != 'silent') { | |
44 StringBuffer sb = new StringBuffer('Test configuration'); | |
45 sb.add(configurations.length > 1 ? 's:' : ':'); | |
46 for (Map conf in configurations) { | |
47 sb.add(' ${conf["compiler"]}_${conf["runtime"]}_${conf["mode"]}_' + | |
48 '${conf["arch"]}'); | |
49 if (conf['checked']) sb.add('_checked'); | |
50 } | |
51 print(sb); | |
52 } | |
53 | |
54 var configurationIterator = configurations.iterator(); | |
55 bool enqueueConfiguration(ProcessQueue queue) { | |
56 if (!configurationIterator.hasNext()) { | |
57 return false; | |
58 } | |
59 | |
60 var conf = configurationIterator.next(); | |
61 if (selectors.containsKey('samples')) { | |
62 queue.addTestSuite(new SamplesTestSuite(conf)); | |
63 } | |
64 if (selectors.containsKey('standalone')) { | |
65 queue.addTestSuite(new StandaloneTestSuite(conf)); | |
66 } | |
67 if (selectors.containsKey('corelib')) { | |
68 queue.addTestSuite(new CorelibTestSuite(conf)); | |
69 } | |
70 if (selectors.containsKey('co19')) { | |
71 queue.addTestSuite(new Co19TestSuite(conf)); | |
72 } | |
73 if (selectors.containsKey('language')) { | |
74 queue.addTestSuite(new LanguageTestSuite(conf)); | |
75 } | |
76 if (selectors.containsKey('isolate')) { | |
77 queue.addTestSuite(new IsolateTestSuite(conf)); | |
78 } | |
79 if (selectors.containsKey('utils')) { | |
80 queue.addTestSuite(new UtilsTestSuite(conf)); | |
81 } | |
82 if (conf['component'] == 'dartc' && selectors.containsKey('dartc')) { | |
83 queue.addTestSuite(new ClientDartcTestSuite(conf)); | |
84 } | |
85 if (conf['component'] == 'dartc' && selectors.containsKey('dartc')) { | |
86 queue.addTestSuite(new JUnitDartcTestSuite(conf)); | |
87 } | |
88 if (selectors.containsKey('client')) { | |
89 queue.addTestSuite(new ClientTestSuite(conf)); | |
90 } | |
91 | |
92 return true; | |
93 } | |
94 | |
95 // Start process queue. | |
96 var queue = new ProcessQueue(maxProcesses, | |
97 progressIndicator, | |
98 startTime, | |
99 printTiming, | |
100 enqueueConfiguration, | |
101 verbose, | |
102 listTests, | |
103 keepGeneratedTests); | |
104 } | |
OLD | NEW |