| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |