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

Unified Diff: tests/compiler/dart2js/serialization_test_data.dart

Issue 1870133002: Refactor serialization test files. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix Created 4 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/serialization_test_data.dart
diff --git a/tests/compiler/dart2js/serialization_analysis_test.dart b/tests/compiler/dart2js/serialization_test_data.dart
similarity index 65%
copy from tests/compiler/dart2js/serialization_analysis_test.dart
copy to tests/compiler/dart2js/serialization_test_data.dart
index 373fb89e5bb98fd572e595c458243612f3747e9a..67d400c764eaeee818e15a9852ac0030203194e3 100644
--- a/tests/compiler/dart2js/serialization_analysis_test.dart
+++ b/tests/compiler/dart2js/serialization_test_data.dart
@@ -1,19 +1,8 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library dart2js.serialization_analysis_test;
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/common/backend_api.dart';
-import 'package:compiler/src/common/names.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/filenames.dart';
-import 'memory_compiler.dart';
-import 'serialization_helper.dart';
+library dart2js.serialization_test_data;
const List<Test> TESTS = const <Test>[
const Test(const {
@@ -201,22 +190,6 @@ main() {
expectedInfoCount: 0),
];
-main(List<String> arguments) {
- asyncTest(() async {
- String serializedData = await serializeDartCore();
-
- if (arguments.isNotEmpty) {
- Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.last));
- await analyze(serializedData, entryPoint, null);
- } else {
- Uri entryPoint = Uri.parse('memory:main.dart');
- for (Test test in TESTS) {
- await analyze(serializedData, entryPoint, test);
- }
- }
- });
-}
-
class Test {
final Map sourceFiles;
final int expectedErrorCount;
@@ -230,28 +203,3 @@ class Test {
this.expectedHintCount: 0,
this.expectedInfoCount: 0});
}
-
-Future analyze(String serializedData, Uri entryPoint, Test test) async {
- DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
- await runCompiler(
- entryPoint: entryPoint,
- memorySourceFiles: test != null ? test.sourceFiles : const {},
- options: [Flags.analyzeOnly],
- diagnosticHandler: diagnosticCollector,
- beforeRun: (Compiler compiler) {
- deserialize(compiler, serializedData);
- });
- if (test != null) {
- Expect.equals(test.expectedErrorCount, diagnosticCollector.errors.length,
- "Unexpected error count.");
- Expect.equals(
- test.expectedWarningCount,
- diagnosticCollector.warnings.length,
- "Unexpected warning count.");
- Expect.equals(test.expectedHintCount, diagnosticCollector.hints.length,
- "Unexpected hint count.");
- Expect.equals(test.expectedInfoCount, diagnosticCollector.infos.length,
- "Unexpected info count.");
- }
-}
-
« no previous file with comments | « tests/compiler/dart2js/serialization_test.dart ('k') | tests/compiler/dart2js/serialization_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698