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

Unified Diff: pkg/dev_compiler/test/worker/worker_test.dart

Issue 2781483007: Report error if the same uri appears in multiple summaries. (Closed)
Patch Set: Refactor and check in analyzer cli Created 3 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 | « pkg/dev_compiler/lib/src/compiler/compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/test/worker/worker_test.dart
diff --git a/pkg/dev_compiler/test/worker/worker_test.dart b/pkg/dev_compiler/test/worker/worker_test.dart
index 7f2aa11686a530a9bb6bb6966c8288d6b406ade7..91688d3227b8abb5cff82f77b7775f82fb71608f 100644
--- a/pkg/dev_compiler/test/worker/worker_test.dart
+++ b/pkg/dev_compiler/test/worker/worker_test.dart
@@ -132,6 +132,9 @@ main() {
final greetingSummary = new File('test/worker/greeting.api.ds').absolute;
final helloJS = new File('test/worker/hello_world.js').absolute;
+ final greeting2JS = new File('test/worker/greeting2.js').absolute;
+ final greeting2Summary = new File('test/worker/greeting2.api.ds').absolute;
+
setUp(() {
greetingDart.writeAsStringSync('String greeting = "hello";');
helloDart.writeAsStringSync('import "greeting.dart";'
@@ -143,6 +146,8 @@ main() {
if (helloDart.existsSync()) helloDart.deleteSync();
if (greetingJS.existsSync()) greetingJS.deleteSync();
if (greetingSummary.existsSync()) greetingSummary.deleteSync();
+ if (greeting2JS.existsSync()) greeting2JS.deleteSync();
+ if (greeting2Summary.existsSync()) greeting2Summary.deleteSync();
if (helloJS.existsSync()) helloJS.deleteSync();
});
@@ -182,6 +187,61 @@ main() {
expect(result.stderr, isEmpty);
expect(helloJS.existsSync(), isTrue);
});
+
+ test('reports error on overlapping summaries', () {
+ final dartSdkSummary = new File('lib/sdk/ddc_sdk.sum').absolute;
+ var result = Process.runSync(Platform.executable, [
+ 'bin/dartdevc.dart',
+ '--summary-extension=api.ds',
+ '--no-source-map',
+ '--dart-sdk-summary',
+ dartSdkSummary.path,
+ '-o',
+ greetingJS.path,
+ greetingDart.path,
+ ]);
+ expect(result.exitCode, EXIT_CODE_OK);
+ expect(result.stdout, isEmpty);
+ expect(result.stderr, isEmpty);
+ expect(greetingJS.existsSync(), isTrue);
+ expect(greetingSummary.existsSync(), isTrue);
+
+ result = Process.runSync(Platform.executable, [
+ 'bin/dartdevc.dart',
+ '--summary-extension=api.ds',
+ '--no-source-map',
+ '--dart-sdk-summary',
+ dartSdkSummary.path,
+ '-o',
+ greeting2JS.path,
+ greetingDart.path,
+ ]);
+ expect(result.exitCode, EXIT_CODE_OK);
+ expect(result.stdout, isEmpty);
+ expect(result.stderr, isEmpty);
+ expect(greeting2JS.existsSync(), isTrue);
+ expect(greeting2Summary.existsSync(), isTrue);
+
+ result = Process.runSync(Platform.executable, [
+ 'bin/dartdevc.dart',
+ '--no-source-map',
+ '--no-summarize',
+ '--dart-sdk-summary',
+ dartSdkSummary.path,
+ '--summary-extension=api.ds',
+ '-s',
+ greetingSummary.path,
+ '-s',
+ greeting2Summary.path,
+ '-o',
+ helloJS.path,
+ helloDart.path,
+ ]);
+ expect(result.exitCode, 65);
+ expect(result.stdout, contains("conflict"));
+ expect(result.stdout, contains(greetingDart.path));
+ expect(helloJS.existsSync(), isFalse);
+ });
});
group('Error handling', () {
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698