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

Side by Side Diff: pkg/front_end/lib/src/fasta/testing/kernel_chain.dart

Issue 2663163005: Update location of rasta tests. (Closed)
Patch Set: Update location of rasta tests. Created 3 years, 10 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 | pkg/front_end/test/fasta/compile_test.dart » ('j') | 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 // TODO(ahe): Copied from closure_conversion branch of kernel, remove this file 5 // TODO(ahe): Copied from closure_conversion branch of kernel, remove this file
6 // when closure_conversion is merged with master. 6 // when closure_conversion is merged with master.
7 7
8 library kernel.testing.kernel_chain; 8 library kernel.testing.kernel_chain;
9 9
10 import 'dart:async' show 10 import 'dart:async' show
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 String get name => "match expectations"; 241 String get name => "match expectations";
242 242
243 Future<Result<Program>> run(Program program, _) async { 243 Future<Result<Program>> run(Program program, _) async {
244 Library library = program.libraries.firstWhere( 244 Library library = program.libraries.firstWhere(
245 (Library library) => library.importUri.scheme != "dart"); 245 (Library library) => library.importUri.scheme != "dart");
246 Uri uri = library.importUri; 246 Uri uri = library.importUri;
247 StringBuffer buffer = new StringBuffer(); 247 StringBuffer buffer = new StringBuffer();
248 new Printer(buffer).writeLibraryFile(library); 248 new Printer(buffer).writeLibraryFile(library);
249 249
250 bool updateExpectations = this.updateExpectations; 250 bool updateExpectations = this.updateExpectations;
251 if (uri.path.contains("/test/rasta/")) { 251 if (uri.path.contains("/test/fasta/rasta/")) {
252 // TODO(ahe): Remove this. Short term, we don't want to automatically 252 // TODO(ahe): Remove this. Short term, we don't want to automatically
253 // update rasta expectations, as we have too many failures. 253 // update rasta expectations, as we have too many failures.
254 updateExpectations = false; 254 updateExpectations = false;
255 } 255 }
256 File expectedFile = new File("${uri.toFilePath()}$suffix"); 256 File expectedFile = new File("${uri.toFilePath()}$suffix");
257 if (await expectedFile.exists()) { 257 if (await expectedFile.exists()) {
258 String expected = await expectedFile.readAsString(); 258 String expected = await expectedFile.readAsString();
259 if (expected.trim() != "$buffer".trim()) { 259 if (expected.trim() != "$buffer".trim()) {
260 if (!updateExpectations) { 260 if (!updateExpectations) {
261 String diff = await runDiff(expectedFile.uri, "$buffer"); 261 String diff = await runDiff(expectedFile.uri, "$buffer");
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 Future openWrite(Uri uri, f(IOSink sink)) async { 386 Future openWrite(Uri uri, f(IOSink sink)) async {
387 IOSink sink = new File.fromUri(uri).openWrite(); 387 IOSink sink = new File.fromUri(uri).openWrite();
388 try { 388 try {
389 await f(sink); 389 await f(sink);
390 } finally { 390 } finally {
391 await sink.close(); 391 await sink.close();
392 } 392 }
393 print("Wrote $uri"); 393 print("Wrote $uri");
394 } 394 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/compile_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698