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

Side by Side Diff: lib/src/run_batch.dart

Issue 2059813002: Don't set a target library in whole-program mode. (Closed) Base URL: git@github.com:dart-lang/rasta.git@type_parse_error
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library rasta.run_batch; 5 library rasta.run_batch;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future, 8 Future,
9 Stream; 9 Stream;
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 listTests(<Uri>[testDirectory], pattern: options.pattern); 73 listTests(<Uri>[testDirectory], pattern: options.pattern);
74 await for (TestDescription description in tests) { 74 await for (TestDescription description in tests) {
75 count++; 75 count++;
76 try { 76 try {
77 Options options = new Options( 77 Options options = new Options(
78 description.uri, 78 description.uri,
79 description.uri.resolve("${description.uri.path}.bart"), 79 description.uri.resolve("${description.uri.path}.bart"),
80 generateLibrary: this.options.generateLibrary); 80 generateLibrary: this.options.generateLibrary);
81 81
82 ir.Library library = await kernel.loadLibrary(options.input); 82 ir.Library library = await kernel.loadLibrary(options.input);
83 kernel.processWorkQueue(targetLibrary: options.input); 83 if (this.options.generateLibrary) {
84 kernel.processWorkQueue(targetLibrary: options.input);
85 } else {
86 kernel.processWorkQueue();
87 }
84 88
85 if (options.generateLibrary == true) { 89 if (options.generateLibrary == true) {
86 await openWrite(options.output, (IOSink sink) { 90 await openWrite(options.output, (IOSink sink) {
87 BinaryPrinter printer = new BinaryPrinter(sink); 91 BinaryPrinter printer = new BinaryPrinter(sink);
88 printer.writeLibraryFile(library); 92 printer.writeLibraryFile(library);
89 }); 93 });
90 } else { 94 } else {
91 Iterable<ir.Procedure> mainMethods = library.procedures.where( 95 Iterable<ir.Procedure> mainMethods = library.procedures.where(
92 (ir.Procedure function) => function.name.name == "main"); 96 (ir.Procedure function) => function.name.name == "main");
93 97
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 Failures: ${failures.length} 142 Failures: ${failures.length}
139 Average time per test: ${averageTimeMs}ms 143 Average time per test: ${averageTimeMs}ms
140 Success rate: ${(100 - failures.length * 100/count).toStringAsFixed(2)}%"""); 144 Success rate: ${(100 - failures.length * 100/count).toStringAsFixed(2)}%""");
141 } 145 }
142 } 146 }
143 147
144 String padTo(int i, int pad) { 148 String padTo(int i, int pad) {
145 String result = (" " * pad) + "$i"; 149 String result = (" " * pad) + "$i";
146 return result.substring(result.length - pad); 150 return result.substring(result.length - pad);
147 } 151 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698