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

Side by Side Diff: tools/testing/dart/runtime_configuration.dart

Issue 2405393002: Use a single file for app snapshots. (Closed)
Patch Set: . Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library runtime_configuration; 5 library runtime_configuration;
6 6
7 import 'dart:io' show Platform;
8
7 import 'compiler_configuration.dart' show CommandArtifact; 9 import 'compiler_configuration.dart' show CommandArtifact;
8 10
9 // TODO(ahe): Remove this import, we can precompute all the values required 11 // TODO(ahe): Remove this import, we can precompute all the values required
10 // from TestSuite once the refactoring is complete. 12 // from TestSuite once the refactoring is complete.
11 import 'test_suite.dart' show TestSuite; 13 import 'test_suite.dart' show TestSuite;
12 14
13 import 'test_runner.dart' show Command, CommandBuilder; 15 import 'test_runner.dart' show Command, CommandBuilder;
14 16
15 // TODO(ahe): I expect this class will become abstract very soon. 17 // TODO(ahe): I expect this class will become abstract very soon.
16 class RuntimeConfiguration { 18 class RuntimeConfiguration {
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 CommandBuilder commandBuilder, 239 CommandBuilder commandBuilder,
238 CommandArtifact artifact, 240 CommandArtifact artifact,
239 List<String> arguments, 241 List<String> arguments,
240 Map<String, String> environmentOverrides) { 242 Map<String, String> environmentOverrides) {
241 String script = artifact.filename; 243 String script = artifact.filename;
242 String type = artifact.mimeType; 244 String type = artifact.mimeType;
243 if (script != null && type != 'application/dart-snapshot') { 245 if (script != null && type != 'application/dart-snapshot') {
244 throw "dart_app cannot run files of type '$type'."; 246 throw "dart_app cannot run files of type '$type'.";
245 } 247 }
246 248
247 var augmentedArgs = new List(); 249 var args = new List();
248 augmentedArgs.add("--run-app-snapshot=${artifact.filename}"); 250 args.addAll(arguments);
249 if (useBlobs) { 251 args.removeLast();
250 augmentedArgs.add("--use-blobs"); 252 args.add("${artifact.filename}/out.jitsnapshot");
251 }
252 augmentedArgs.addAll(arguments);
253 253
254 return <Command>[ 254 return <Command>[
255 commandBuilder.getVmCommand(suite.dartVmBinaryFileName, 255 commandBuilder.getVmCommand(suite.dartVmBinaryFileName,
256 augmentedArgs, environmentOverrides) 256 args, environmentOverrides)
257 ]; 257 ];
258 } 258 }
259 } 259 }
260 260
261 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration { 261 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration {
262 final bool useBlobs; 262 final bool useBlobs;
263 DartPrecompiledRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs; 263 DartPrecompiledRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs;
264 264
265 List<Command> computeRuntimeCommands( 265 List<Command> computeRuntimeCommands(
266 TestSuite suite, 266 TestSuite suite,
267 CommandBuilder commandBuilder, 267 CommandBuilder commandBuilder,
268 CommandArtifact artifact, 268 CommandArtifact artifact,
269 List<String> arguments, 269 List<String> arguments,
270 Map<String, String> environmentOverrides) { 270 Map<String, String> environmentOverrides) {
271 String script = artifact.filename; 271 String script = artifact.filename;
272 String type = artifact.mimeType; 272 String type = artifact.mimeType;
273 if (script != null && type != 'application/dart-precompiled') { 273 if (script != null && type != 'application/dart-precompiled') {
274 throw "dart_precompiled cannot run files of type '$type'."; 274 throw "dart_precompiled cannot run files of type '$type'.";
275 } 275 }
276 276
277 var augmentedArgs = new List(); 277 var args = new List();
278 augmentedArgs.add("--run-app-snapshot=${artifact.filename}"); 278 args.addAll(arguments);
279 args.removeLast();
279 if (useBlobs) { 280 if (useBlobs) {
280 augmentedArgs.add("--use-blobs"); 281 args.add("${artifact.filename}/out.aotsnapshot");
282 } else {
283 if (Platform.isLinux) {
284 args.add("${artifact.filename}/libprecompiled.so");
285 } else if (Platform.isMacOS) {
286 args.add("${artifact.filename}/libprecompiled.dylib");
siva 2016/10/12 20:37:33 if any name for the dynamic libraries work then we
287 } else {
288 throw "Not implemented for ${Platform.name}";
289 }
281 } 290 }
282 augmentedArgs.addAll(arguments);
283 291
284 return <Command>[ 292 return <Command>[
285 commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName, 293 commandBuilder.getVmCommand(suite.dartPrecompiledBinaryFileName,
286 augmentedArgs, environmentOverrides) 294 args, environmentOverrides)
287 ]; 295 ];
288 } 296 }
289 } 297 }
290 298
291 class DartPrecompiledAdbRuntimeConfiguration 299 class DartPrecompiledAdbRuntimeConfiguration
292 extends DartVmRuntimeConfiguration { 300 extends DartVmRuntimeConfiguration {
293 final bool useBlobs; 301 final bool useBlobs;
294 DartPrecompiledAdbRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs; 302 DartPrecompiledAdbRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs;
295 303
296 List<Command> computeRuntimeCommands( 304 List<Command> computeRuntimeCommands(
(...skipping 24 matching lines...) Expand all
321 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { 329 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration {
322 List<Command> computeRuntimeCommands( 330 List<Command> computeRuntimeCommands(
323 TestSuite suite, 331 TestSuite suite,
324 CommandBuilder commandBuilder, 332 CommandBuilder commandBuilder,
325 CommandArtifact artifact, 333 CommandArtifact artifact,
326 List<String> arguments, 334 List<String> arguments,
327 Map<String, String> environmentOverrides) { 335 Map<String, String> environmentOverrides) {
328 throw "Unimplemented runtime '$runtimeType'"; 336 throw "Unimplemented runtime '$runtimeType'";
329 } 337 }
330 } 338 }
OLDNEW
« runtime/include/dart_api.h ('K') | « tools/testing/dart/compiler_configuration.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698