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

Unified Diff: tests/compiler/dart2js/kernel/closed_world2_test.dart

Issue 2835323004: Handle @NoInline annotations in closed_world2_test (Closed)
Patch Set: Created 3 years, 8 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
Index: tests/compiler/dart2js/kernel/closed_world2_test.dart
diff --git a/tests/compiler/dart2js/kernel/closed_world2_test.dart b/tests/compiler/dart2js/kernel/closed_world2_test.dart
index 7056cc1f2ec85e38c0b162cc400d8c908ee03685..6d0aa7cffebff4c09f40b0742f96f3f02378d1ac 100644
--- a/tests/compiler/dart2js/kernel/closed_world2_test.dart
+++ b/tests/compiler/dart2js/kernel/closed_world2_test.dart
@@ -55,7 +55,9 @@ import 'impact_test.dart';
const SOURCE = const {
'main.dart': '''
import 'dart:html';
+import 'package:expect/expect.dart';
+@NoInline()
main() {
print('Hello World');
''.contains; // Trigger member closurization.
@@ -70,7 +72,8 @@ main(List<String> args) {
});
}
-Future mainInternal(List<String> args) async {
+Future mainInternal(List<String> args,
+ {bool skipWarnings: false, bool skipErrors: false}) async {
Arguments arguments = new Arguments.from(args);
Uri entryPoint;
Map<String, String> memorySourceFiles;
@@ -85,13 +88,23 @@ Future mainInternal(List<String> args) async {
enableDebugMode();
print('---- analyze-only ------------------------------------------------');
+ DiagnosticCollector collector = new DiagnosticCollector();
Compiler compiler1 = compilerFor(
entryPoint: entryPoint,
memorySourceFiles: memorySourceFiles,
+ diagnosticHandler: collector,
options: [Flags.analyzeOnly, Flags.enableAssertMessage]);
ElementResolutionWorldBuilder.useInstantiationMap = true;
compiler1.resolution.retainCachesForTesting = true;
await compiler1.run(entryPoint);
+ if (collector.errors.isNotEmpty && skipErrors) {
+ print('Skipping due to errors.');
+ return;
+ }
+ if (collector.warnings.isNotEmpty && skipWarnings) {
+ print('Skipping due to warnings.');
+ return;
+ }
Expect.isFalse(compiler1.compilationFailed);
ResolutionEnqueuer enqueuer1 = compiler1.enqueuer.resolution;
BackendUsage backendUsage1 = compiler1.backend.backendUsage;

Powered by Google App Engine
This is Rietveld 408576698