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

Unified Diff: lib/src/testing.dart

Issue 1013363002: locating runtime files automatically (fixes #96) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/options.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/testing.dart
diff --git a/lib/src/testing.dart b/lib/src/testing.dart
index bdb3120b37d8f2ce8789fba369b59c266a757783..51a7bed068ef7707eec459678e6464c871837cbf 100644
--- a/lib/src/testing.dart
+++ b/lib/src/testing.dart
@@ -23,6 +23,8 @@ import 'package:dev_compiler/src/report.dart';
import 'package:dev_compiler/config.dart';
import 'package:dev_compiler/devc.dart' show Compiler;
+import 'dependency_graph.dart' show runtimeFilesForServerMode;
+
/// Run the checker on a program with files contents as indicated in
/// [testFiles].
///
@@ -67,6 +69,7 @@ CheckerResults testChecker(Map<String, String> testFiles,
nonnullableTypes: nonnullableTypes,
useMockSdk: sdkDir == null,
dartSdkPath: sdkDir,
+ runtimeDir: '/dev_compiler_runtime/',
entryPointFile: '/main.dart');
var resolver = sdkDir == null
? new TypeResolver.fromMock(mockSdkSources, options,
@@ -278,6 +281,11 @@ class TestUriResolver extends UriResolver {
var uri = key.startsWith('package:') ? Uri.parse(key) : new Uri.file(key);
files[uri] = new TestSource(uri, value);
});
+
+ runtimeFilesForServerMode.forEach((filepath) {
+ var uri = Uri.parse('/dev_compiler_runtime/$filepath');
+ files[uri] = new TestSource(uri, '/* test contents of $filepath */');
+ });
}
Source resolveAbsolute(Uri uri) {
« no previous file with comments | « lib/src/options.dart ('k') | lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698