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

Side by Side Diff: pkg/kernel/test/interpreter/suite.dart

Issue 2895983002: Read SDK and patches from a JSON file. (Closed)
Patch Set: Merged with 1333f97b9a0e3805f991578ef83b0ec4553ecf33 Created 3 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
« no previous file with comments | « pkg/kernel/test/closures/suite.dart ('k') | runtime/vm/libraries.json » ('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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 test.kernel.closures.suite; 5 library test.kernel.closures.suite;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:io' show File; 9 import 'dart:io' show File;
10 10
11 import 'package:front_end/physical_file_system.dart'; 11 import 'package:front_end/physical_file_system.dart' show PhysicalFileSystem;
12
12 import 'package:testing/testing.dart' 13 import 'package:testing/testing.dart'
13 show Chain, ChainContext, Result, Step, TestDescription, runMe; 14 show Chain, ChainContext, Result, Step, TestDescription, runMe;
14 15
16 import 'package:front_end/src/fasta/testing/patched_sdk_location.dart'
17 show computePatchedSdk;
18
15 import 'package:kernel/ast.dart' show Program, Library; 19 import 'package:kernel/ast.dart' show Program, Library;
16 20
17 import 'package:front_end/src/fasta/testing/kernel_chain.dart' show runDiff; 21 import 'package:front_end/src/fasta/testing/kernel_chain.dart' show runDiff;
18 22
19 import 'package:front_end/src/fasta/ticker.dart' show Ticker; 23 import 'package:front_end/src/fasta/ticker.dart' show Ticker;
20 24
21 import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget; 25 import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget;
22 26
23 import 'package:front_end/src/fasta/kernel/kernel_target.dart' 27 import 'package:front_end/src/fasta/kernel/kernel_target.dart'
24 show KernelTarget; 28 show KernelTarget;
(...skipping 26 matching lines...) Expand all
51 const MatchLogExpectation(".expect"), 55 const MatchLogExpectation(".expect"),
52 ]; 56 ];
53 57
54 Future<Program> loadPlatform() async { 58 Future<Program> loadPlatform() async {
55 Uri sdk = await computePatchedSdk(); 59 Uri sdk = await computePatchedSdk();
56 return loadProgramFromBinary(sdk.resolve('platform.dill').toFilePath()); 60 return loadProgramFromBinary(sdk.resolve('platform.dill').toFilePath());
57 } 61 }
58 62
59 static Future<InterpreterContext> create( 63 static Future<InterpreterContext> create(
60 Chain suite, Map<String, String> environment) async { 64 Chain suite, Map<String, String> environment) async {
65 Uri sdk = await computePatchedSdk();
61 Uri packages = Uri.base.resolve(".packages"); 66 Uri packages = Uri.base.resolve(".packages");
62 bool strongMode = environment.containsKey(STRONG_MODE); 67 bool strongMode = environment.containsKey(STRONG_MODE);
63 TranslateUri uriTranslator = 68 TranslateUri uriTranslator = await TranslateUri
64 await TranslateUri.parse(PhysicalFileSystem.instance, packages); 69 .parse(PhysicalFileSystem.instance, sdk, packages: packages);
65 return new InterpreterContext(strongMode, uriTranslator); 70 return new InterpreterContext(strongMode, uriTranslator);
66 } 71 }
67 } 72 }
68 73
69 class FastaCompile extends Step<TestDescription, Program, InterpreterContext> { 74 class FastaCompile extends Step<TestDescription, Program, InterpreterContext> {
70 const FastaCompile(); 75 const FastaCompile();
71 76
72 String get name => "fasta compile"; 77 String get name => "fasta compile";
73 78
74 Future<Result<Program>> run( 79 Future<Result<Program>> run(
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 final Uri uri; 153 final Uri uri;
149 154
150 /// Evaluated program log. 155 /// Evaluated program log.
151 final String log; 156 final String log;
152 157
153 EvaluationLog(this.uri, this.log); 158 EvaluationLog(this.uri, this.log);
154 } 159 }
155 160
156 main(List<String> arguments) => 161 main(List<String> arguments) =>
157 runMe(arguments, InterpreterContext.create, "testing.json"); 162 runMe(arguments, InterpreterContext.create, "testing.json");
OLDNEW
« no previous file with comments | « pkg/kernel/test/closures/suite.dart ('k') | runtime/vm/libraries.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698