OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:io'; | 5 import 'dart:io'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 | 7 |
8 List<Map> LINUX_COMBINATIONS = [ | 8 List<Map> LINUX_COMBINATIONS = [ |
9 { | 9 { |
10 'runtimes' : ['none'], | 10 'runtimes': ['none'], |
11 'modes' : ['release'], | 11 'modes': ['release'], |
12 'archs' : ['x64'], | 12 'archs': ['x64'], |
13 'compiler' : 'dart2analyzer' | 13 'compiler': 'dart2analyzer' |
14 }, | 14 }, |
15 { | 15 { |
16 'runtimes' : ['vm'], | 16 'runtimes': ['vm'], |
17 'modes' : ['debug', 'release'], | 17 'modes': ['debug', 'release'], |
18 'archs' : ['ia32', 'x64', 'simarm', 'simmips'], | 18 'archs': ['ia32', 'x64', 'simarm', 'simmips'], |
19 'compiler' : 'none' | 19 'compiler': 'none' |
20 }, | 20 }, |
21 { | 21 { |
22 'runtimes' : ['d8', 'jsshell', 'chrome', 'ff'], | 22 'runtimes': ['d8', 'jsshell', 'chrome', 'ff'], |
23 'modes' : ['release'], | 23 'modes': ['release'], |
24 'archs' : ['ia32'], | 24 'archs': ['ia32'], |
25 'compiler' : 'dart2js' | 25 'compiler': 'dart2js' |
26 }, | 26 }, |
27 { | 27 { |
28 'runtimes' : ['dartium'], | 28 'runtimes': ['dartium'], |
29 'modes' : ['release', 'debug'], | 29 'modes': ['release', 'debug'], |
30 'archs' : ['ia32'], | 30 'archs': ['ia32'], |
31 'compiler' : 'none' | 31 'compiler': 'none' |
32 }, | 32 }, |
33 ]; | 33 ]; |
34 | 34 |
35 List<Map> MACOS_COMBINATIONS = [ | 35 List<Map> MACOS_COMBINATIONS = [ |
36 { | 36 { |
37 'runtimes' : ['vm'], | 37 'runtimes': ['vm'], |
38 'modes' : ['debug', 'release'], | 38 'modes': ['debug', 'release'], |
39 'archs' : ['ia32', 'x64'], | 39 'archs': ['ia32', 'x64'], |
40 'compiler' : 'none' | 40 'compiler': 'none' |
41 }, | 41 }, |
42 { | 42 { |
43 'runtimes' : ['safari', 'safarimobilesim'], | 43 'runtimes': ['safari', 'safarimobilesim'], |
44 'modes' : ['release'], | 44 'modes': ['release'], |
45 'archs' : ['ia32'], | 45 'archs': ['ia32'], |
46 'compiler' : 'dart2js' | 46 'compiler': 'dart2js' |
47 }, | 47 }, |
48 { | 48 { |
49 'runtimes' : ['dartium'], | 49 'runtimes': ['dartium'], |
50 'modes' : ['release', 'debug'], | 50 'modes': ['release', 'debug'], |
51 'archs' : ['ia32'], | 51 'archs': ['ia32'], |
52 'compiler' : 'none' | 52 'compiler': 'none' |
53 }, | 53 }, |
54 ]; | 54 ]; |
55 | 55 |
56 List<Map> WINDOWS_COMBINATIONS = [ | 56 List<Map> WINDOWS_COMBINATIONS = [ |
57 { | 57 { |
58 'runtimes' : ['vm'], | 58 'runtimes': ['vm'], |
59 'modes' : ['debug', 'release'], | 59 'modes': ['debug', 'release'], |
60 'archs' : ['ia32', 'x64'], | 60 'archs': ['ia32', 'x64'], |
61 'compiler' : 'none' | 61 'compiler': 'none' |
62 }, | 62 }, |
63 { | 63 { |
64 'runtimes' : ['chrome', 'ff', 'ie11', 'ie10'], | 64 'runtimes': ['chrome', 'ff', 'ie11', 'ie10'], |
65 'modes' : ['release'], | 65 'modes': ['release'], |
66 'archs' : ['ia32'], | 66 'archs': ['ia32'], |
67 'compiler' : 'dart2js' | 67 'compiler': 'dart2js' |
68 }, | 68 }, |
69 { | 69 { |
70 'runtimes' : ['dartium'], | 70 'runtimes': ['dartium'], |
71 'modes' : ['release', 'debug'], | 71 'modes': ['release', 'debug'], |
72 'archs' : ['ia32'], | 72 'archs': ['ia32'], |
73 'compiler' : 'none' | 73 'compiler': 'none' |
74 }, | 74 }, |
75 ]; | 75 ]; |
76 | 76 |
77 Map<String, List<Map>> COMBINATIONS = { | 77 Map<String, List<Map>> COMBINATIONS = { |
78 'linux' : LINUX_COMBINATIONS, | 78 'linux': LINUX_COMBINATIONS, |
79 'windows' : WINDOWS_COMBINATIONS, | 79 'windows': WINDOWS_COMBINATIONS, |
80 'macos' : MACOS_COMBINATIONS | 80 'macos': MACOS_COMBINATIONS |
81 }; | 81 }; |
82 | 82 |
83 List<Map> getCombinations() { | 83 List<Map> getCombinations() { |
84 return COMBINATIONS[Platform.operatingSystem]; | 84 return COMBINATIONS[Platform.operatingSystem]; |
85 } | 85 } |
86 | 86 |
87 void ensureBuild(Iterable<String> modes, Iterable<String> archs) { | 87 void ensureBuild(Iterable<String> modes, Iterable<String> archs) { |
88 print('Building many platforms. Please be patient.'); | 88 print('Building many platforms. Please be patient.'); |
89 | 89 |
90 var archString = '-a${archs.join(',')}'; | 90 var archString = '-a${archs.join(',')}'; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 | 159 |
160 for (var arch in combination['archs']) { | 160 for (var arch in combination['archs']) { |
161 if (!arches.contains(arch)) { | 161 if (!arches.contains(arch)) { |
162 continue; | 162 continue; |
163 } | 163 } |
164 | 164 |
165 for (var runtime in combination['runtimes']) { | 165 for (var runtime in combination['runtimes']) { |
166 var compiler = combination['compiler']; | 166 var compiler = combination['compiler']; |
167 | 167 |
168 var args = ['tools/test.py', '-m$mode', '-c$compiler', '-r$runtime', | 168 var args = [ |
169 '-a$arch', '--report-in-json', '--use-sdk']; | 169 'tools/test.py', |
| 170 '-m$mode', |
| 171 '-c$compiler', |
| 172 '-r$runtime', |
| 173 '-a$arch', |
| 174 '--report-in-json', |
| 175 '--use-sdk' |
| 176 ]; |
170 var result = Process.runSync('python', args); | 177 var result = Process.runSync('python', args); |
171 if (result.exitCode != 0) { | 178 if (result.exitCode != 0) { |
172 print(result.stdout); | 179 print(result.stdout); |
173 print(result.stderr); | 180 print(result.stderr); |
174 throw new Exception("Error running: ${args.join(" ")}"); | 181 throw new Exception("Error running: ${args.join(" ")}"); |
175 } | 182 } |
176 | 183 |
177 // Find "JSON:" | 184 // Find "JSON:" |
178 // Everything after will the JSON-formatted output | 185 // Everything after will the JSON-formatted output |
179 // per --report-in-json flag above | 186 // per --report-in-json flag above |
(...skipping 15 matching lines...) Expand all Loading... |
195 } | 202 } |
196 print(headers.join(',')); | 203 print(headers.join(',')); |
197 } | 204 } |
198 | 205 |
199 var total = map['total']; | 206 var total = map['total']; |
200 var values = [compiler, runtime, arch, mode, total]; | 207 var values = [compiler, runtime, arch, mode, total]; |
201 | 208 |
202 for (var key in keys) { | 209 for (var key in keys) { |
203 var value = map[key]; | 210 var value = map[key]; |
204 values.add(value); | 211 values.add(value); |
205 var pct = 100*(value/total); | 212 var pct = 100 * (value / total); |
206 values.add('${pct.toStringAsFixed(3)}%'); | 213 values.add('${pct.toStringAsFixed(3)}%'); |
207 } | 214 } |
208 | 215 |
209 print(values.join(',')); | 216 print(values.join(',')); |
210 } | 217 } |
211 } | 218 } |
212 } | 219 } |
213 } | 220 } |
214 } | 221 } |
OLD | NEW |