Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: tools/test.dart

Issue 11817012: Migration of testing scripts in tools/ to libv2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added binaries Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 6 /**
7 * This file is the entrypoint of the dart test suite. This suite is used 7 * This file is the entrypoint of the dart test suite. This suite is used
8 * to test: 8 * to test:
9 * 9 *
10 * 1. the dart vm 10 * 1. the dart vm
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 // Print the configurations being run by this execution of 92 // Print the configurations being run by this execution of
93 // test.dart. However, don't do it if the silent progress indicator 93 // test.dart. However, don't do it if the silent progress indicator
94 // is used. This is only needed because of the junit tests. 94 // is used. This is only needed because of the junit tests.
95 if (progressIndicator != 'silent') { 95 if (progressIndicator != 'silent') {
96 List output_words = configurations.length > 1 ? 96 List output_words = configurations.length > 1 ?
97 ['Test configurations:'] : ['Test configuration:']; 97 ['Test configurations:'] : ['Test configuration:'];
98 for (Map conf in configurations) { 98 for (Map conf in configurations) {
99 List settings = 99 List settings =
100 ['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]); 100 ['compiler', 'runtime', 'mode', 'arch'].mappedBy((name) => conf[name]) ;
Bill Hesse 2013/01/09 17:06:33 toList()
kustermann 2013/01/09 18:02:25 Done.
101 if (conf['checked']) settings.add('checked'); 101 if (conf['checked']) settings.add('checked');
102 output_words.add(Strings.join(settings, '_')); 102 output_words.add(Strings.join(settings, '_'));
103 } 103 }
104 print(Strings.join(output_words, ' ')); 104 print(Strings.join(output_words, ' '));
105 } 105 }
106 106
107 var configurationIterator = configurations.iterator(); 107 var configurationIterator = configurations.iterator;
108 void enqueueConfiguration(ProcessQueue queue) { 108 void enqueueConfiguration(ProcessQueue queue) {
109 if (!configurationIterator.hasNext) return; 109 if (!configurationIterator.moveNext()) return;
110 110
111 var conf = configurationIterator.next(); 111 var conf = configurationIterator.current;
112 for (String key in selectors.keys) { 112 for (String key in selectors.keys) {
113 if (key == 'co19') { 113 if (key == 'co19') {
114 queue.addTestSuite(new Co19TestSuite(conf)); 114 queue.addTestSuite(new Co19TestSuite(conf));
115 } else if (conf['runtime'] == 'vm' && key == 'vm') { 115 } else if (conf['runtime'] == 'vm' && key == 'vm') {
116 // vm tests contain both cc tests (added here) and dart tests (added in 116 // vm tests contain both cc tests (added here) and dart tests (added in
117 // [TEST_SUITE_DIRECTORIES]). 117 // [TEST_SUITE_DIRECTORIES]).
118 queue.addTestSuite(new VMTestSuite(conf)); 118 queue.addTestSuite(new VMTestSuite(conf));
119 } else if (conf['compiler'] == 'dartc' && key == 'dartc') { 119 } else if (conf['compiler'] == 'dartc' && key == 'dartc') {
120 queue.addTestSuite(new SamplesDartcTestSuite(conf)); 120 queue.addTestSuite(new SamplesDartcTestSuite(conf));
121 queue.addTestSuite(new JUnitDartcTestSuite(conf)); 121 queue.addTestSuite(new JUnitDartcTestSuite(conf));
122 } 122 }
123 } 123 }
124 124
125 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { 125 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) {
126 final name = testSuiteDir.filename; 126 final name = testSuiteDir.filename;
127 if (selectors.containsKey(name)) { 127 if (selectors.containsKey(name)) {
128 queue.addTestSuite( 128 queue.addTestSuite(
129 new StandardTestSuite.forDirectory(conf, testSuiteDir)); 129 new StandardTestSuite.forDirectory(conf, testSuiteDir));
130 } 130 }
131 } 131 }
132 } 132 }
133 133
134 // Start global http server that serves the entire dart repo. 134 // Start global http server that serves the entire dart repo.
135 // The http server is available on localhost:9876 for any 135 // The http server is available on localhost:9876 for any
136 // test that needs to load resources from the repo over http. 136 // test that needs to load resources from the repo over http.
137 if (!listTests) { 137 if (!listTests) {
138 // Only start the server if we are running browser tests. 138 // Only start the server if we are running browser tests.
139 var runningBrowserTests = configurations.some((config) { 139 var runningBrowserTests = configurations.any((config) {
140 return TestUtils.isBrowserRuntime(config['runtime']); 140 return TestUtils.isBrowserRuntime(config['runtime']);
141 }); 141 });
142 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); 142 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876);
143 } 143 }
144 144
145 // Start process queue. 145 // Start process queue.
146 new ProcessQueue(maxProcesses, 146 new ProcessQueue(maxProcesses,
147 progressIndicator, 147 progressIndicator,
148 startTime, 148 startTime,
149 printTiming, 149 printTiming,
150 enqueueConfiguration, 150 enqueueConfiguration,
151 () => terminateHttpServer(), 151 () => terminateHttpServer(),
152 verbose, 152 verbose,
153 listTests); 153 listTests);
154 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698