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

Unified Diff: pkg/front_end/test/incremental_kernel_generator_test.dart

Issue 2899883002: Add a test for including all libraries from changed to the entry point. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/incremental_kernel_generator_test.dart
diff --git a/pkg/front_end/test/incremental_kernel_generator_test.dart b/pkg/front_end/test/incremental_kernel_generator_test.dart
index 5e636c070c480111534d145949ff0a7d2ce9c88e..4f5cafee809cd60139258d5a69a1aa9b3b24d0dc 100644
--- a/pkg/front_end/test/incremental_kernel_generator_test.dart
+++ b/pkg/front_end/test/incremental_kernel_generator_test.dart
@@ -238,6 +238,59 @@ static field b::B b;
''');
}
+ test_compile_includePathToMain() async {
+ writeFile('/test/.packages', 'test:lib/');
+ String aPath = '/test/lib/a.dart';
+ String bPath = '/test/lib/b.dart';
+ String cPath = '/test/lib/c.dart';
+ String dPath = '/test/lib/d.dart';
+
+ // A --> B -> C
+ // \-> D
+
+ Uri aUri = writeFile(
+ aPath,
+ r'''
+import 'b.dart';
+import 'd.dart';
+main() {
+ b();
+ d();
+}
+''');
+ Uri bUri = writeFile(
+ bPath,
+ r'''
+import 'c.dart';
+b() {
+ c();
+}
+''');
+ Uri cUri = writeFile(cPath, 'c() { print(0); }');
+ Uri dUri = writeFile(dPath, 'd() {}');
+
+ {
+ Program program = await getInitialState(aUri);
+ _assertLibraryUris(program,
+ includes: [aUri, bUri, cUri, dUri, Uri.parse('dart:core')]);
+ }
+
+ // Update c.dart and compute the delta.
+ // It should include the changed c.dart, the affected b.dart, and
+ // also a.dart because VM requires this (because of possible inlining).
+ // But d.dart is not on the path from main() to the changed c.dart,
+ // so it is not included.
+ writeFile(cPath, 'c() { print(1); }');
+ incrementalKernelGenerator.invalidate(cUri);
+ {
+ DeltaProgram delta = await incrementalKernelGenerator.computeDelta();
+ Program program = delta.newProgram;
+ _assertLibraryUris(program,
+ includes: [aUri, bUri, cUri],
+ excludes: [dUri, Uri.parse('dart:core')]);
+ }
+ }
+
test_compile_typedef() async {
writeFile('/test/.packages', 'test:lib/');
String aPath = '/test/lib/a.dart';
« no previous file with comments | « pkg/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698