Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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 // TODO(ager): Get rid of this version of test.dart when we don't have | 6 // TODO(ager): Get rid of this version of test.dart when we don't have |
| 7 // to worry about the special runtime checkout anymore. | 7 // to worry about the special runtime checkout anymore. |
| 8 // This file is identical to test.dart with test suites in the | 8 // This file is identical to test.dart with test suites in the |
| 9 // directories samples, client, compiler, and utils removed. | 9 // directories samples, client, compiler, and utils removed. |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 // Print the configurations being run by this execution of | 60 // Print the configurations being run by this execution of |
| 61 // test.dart. However, don't do it if the silent progress indicator | 61 // test.dart. However, don't do it if the silent progress indicator |
| 62 // is used. This is only needed because of the junit tests. | 62 // is used. This is only needed because of the junit tests. |
| 63 if (progressIndicator != 'silent') { | 63 if (progressIndicator != 'silent') { |
| 64 List output_words = configurations.length > 1 ? | 64 List output_words = configurations.length > 1 ? |
| 65 ['Test configurations:'] : ['Test configuration:']; | 65 ['Test configurations:'] : ['Test configuration:']; |
| 66 for (Map conf in configurations) { | 66 for (Map conf in configurations) { |
| 67 List settings = | 67 List settings = |
| 68 ['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]); | 68 ['compiler', 'runtime', 'mode', 'arch'].mappedBy((name) => conf[name]) ; |
|
Bill Hesse
2013/01/09 17:06:33
You need toList here, unless you change settings t
kustermann
2013/01/09 18:02:25
Done.
| |
| 69 if (conf['checked']) settings.add('checked'); | 69 if (conf['checked']) settings.add('checked'); |
| 70 output_words.add(Strings.join(settings, '_')); | 70 output_words.add(Strings.join(settings, '_')); |
| 71 } | 71 } |
| 72 print(Strings.join(output_words, ' ')); | 72 print(Strings.join(output_words, ' ')); |
| 73 } | 73 } |
| 74 | 74 |
| 75 var configurationIterator = configurations.iterator(); | 75 var configurationIterator = configurations.iterator; |
| 76 void enqueueConfiguration(ProcessQueue queue) { | 76 void enqueueConfiguration(ProcessQueue queue) { |
| 77 if (!configurationIterator.hasNext) return; | 77 if (!configurationIterator.moveNext()) return; |
| 78 | 78 |
| 79 var conf = configurationIterator.next(); | 79 var conf = configurationIterator.current; |
| 80 if (selectors.containsKey('co19')) { | 80 if (selectors.containsKey('co19')) { |
| 81 queue.addTestSuite(new Co19TestSuite(conf)); | 81 queue.addTestSuite(new Co19TestSuite(conf)); |
| 82 } | 82 } |
| 83 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { | 83 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { |
| 84 // vm tests contain both cc tests (added here) and dart tests (added in | 84 // vm tests contain both cc tests (added here) and dart tests (added in |
| 85 // [TEST_SUITE_DIRECTORIES]). | 85 // [TEST_SUITE_DIRECTORIES]). |
| 86 queue.addTestSuite(new VMTestSuite(conf)); | 86 queue.addTestSuite(new VMTestSuite(conf)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 89 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 90 final name = testSuiteDir.filename; | 90 final name = testSuiteDir.filename; |
| 91 if (selectors.containsKey(name)) { | 91 if (selectors.containsKey(name)) { |
| 92 queue.addTestSuite( | 92 queue.addTestSuite( |
| 93 new StandardTestSuite.forDirectory(conf, testSuiteDir)); | 93 new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 // Start global http server that serves the entire dart repo. | 98 // Start global http server that serves the entire dart repo. |
| 99 // The http server is available on localhost:9876 for any | 99 // The http server is available on localhost:9876 for any |
| 100 // test that needs to load resources from the repo over http. | 100 // test that needs to load resources from the repo over http. |
| 101 if (!listTests) { | 101 if (!listTests) { |
| 102 // Only start the server if we are running browser tests. | 102 // Only start the server if we are running browser tests. |
| 103 var runningBrowserTests = configurations.some((config) { | 103 var runningBrowserTests = configurations.any((config) { |
| 104 return TestUtils.isBrowserRuntime(config['runtime']); | 104 return TestUtils.isBrowserRuntime(config['runtime']); |
| 105 }); | 105 }); |
| 106 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); | 106 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Start process queue. | 109 // Start process queue. |
| 110 new ProcessQueue( | 110 new ProcessQueue( |
| 111 maxProcesses, | 111 maxProcesses, |
| 112 progressIndicator, | 112 progressIndicator, |
| 113 startTime, | 113 startTime, |
| 114 printTiming, | 114 printTiming, |
| 115 enqueueConfiguration, | 115 enqueueConfiguration, |
| 116 () => terminateHttpServer(), | 116 () => terminateHttpServer(), |
| 117 verbose, | 117 verbose, |
| 118 listTests); | 118 listTests); |
| 119 } | 119 } |
| OLD | NEW |