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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart2js_profile_many.dart

Issue 288343014: dart2dart: Test cases for better code coverage in dart_tree rewritings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dart2js.profile_many;
6
7 import 'dart2js.dart' as cmdline;
8 import 'dart:async';
9
10 const String USAGE =
11 """
12 Usage: dart2js_profile_many.dart [OPTIONS] [FILES]
13
14 Invokes dart2js separately for each file using the given options.
15 This for profiling multiple compilations in the Dart Observatory.
sigurdm 2014/05/27 12:05:34 This for => This is for
asgerf 2014/05/27 12:25:33 Done.
16 """;
17
18 printUsage() {
19 print(USAGE);
20 }
21
22 void main(List<String> args) {
23
24 List options = [];
25 List files = [];
26
27 for (String arg in args) {
28 if (arg.startsWith('-')) {
29 options.add(arg);
30 } else {
31 files.add(arg);
32 }
33 }
34
35 if (files.length == 0) {
36 printUsage();
37 return;
38 }
39
40 cmdline.exitFunc = (code) {
41 throw "Exit with code $code";
42 };
43
44 compileFile(int index) {
sigurdm 2014/05/27 12:05:34 Maybe iterating through the files and compiling ea
asgerf 2014/05/27 12:25:33 Much better, thanks.
45 if (index == files.length) {
46 print("Done");
47 return;
48 }
49 String file = files[index];
50 List subargs = [];
51 subargs.addAll(options);
52 subargs.add(file);
53 Future future = cmdline.compilerMain(subargs);
54 future.catchError((e) { })
55 .then((_) { compileFile(index+1); });
56 }
57
58 compileFile(0);
59
60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698