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

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

Issue 1562023002: Add test of unittests. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 11 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 | « tests/compiler/dart2js/analyze_helper.dart ('k') | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/analyze_test_test.dart
diff --git a/tests/compiler/dart2js/analyze_test_test.dart b/tests/compiler/dart2js/analyze_test_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f27b7baf29b51faa503f5732faa3ebd7107b28ba
--- /dev/null
+++ b/tests/compiler/dart2js/analyze_test_test.dart
@@ -0,0 +1,81 @@
+// 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.analyze_test.test;
+
+import 'dart:io';
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/apiimpl.dart' show
sigurdm 2016/01/06 12:34:44 Nit: unused import
+ CompilerImpl;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show
+ MessageKind;
+import 'package:compiler/src/filenames.dart' show
+ nativeToUriPath;
+
+import 'analyze_helper.dart';
+import 'memory_compiler.dart';
+
+/**
+ * Map of white-listed warnings and errors.
+ *
+ * Use an identifiable suffix of the file uri as key. Use a fixed substring of
+ * the error/warning message in the list of white-listings for each file.
+ */
+// TODO(johnniwinther): Support canonical URIs as keys and message kinds as
+// values.
+const Map<String, List/*<String|MessageKind>*/> WHITE_LIST = const {
+ "analyze_all_test.dart": const [
+ MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
+ ],
+ "/test/src/util/": const [
+ "Library 'package:async/async.dart' doesn't export a "
Siggi Cherem (dart-lang) 2016/01/08 21:03:19 I'm seeing a local failure related to this line. T
+ "'ForkableStream' declaration.",
+ ],
+ "mirrors_test.dart": const [
+ MessageKind.INVALID_SYMBOL,
+ MessageKind.PRIVATE_IDENTIFIER,
+ ],
+};
+
+const List<String> SKIP_LIST = const <String>[
+ // Helper files:
+ "dart2js_batch2_run.dart",
+ "http_launch_data/",
+ "mirrors_helper.dart",
+ "path%20with%20spaces/",
+ "one_line_dart_program.dart",
+ "sourcemaps/invokes_test_file.dart",
+ // No longer maintained:
+ "backend_dart/",
+ // Broken tests:
+ "http_test.dart",
+];
+
+main(List<String> arguments) {
+ bool verbose = arguments.contains('-v');
+
+ List<String> options = <String>[
+ Flags.analyzeOnly,
+ Flags.analyzeMain,
+ '--categories=Client,Server'];
+ if (verbose) {
+ options.add(Flags.verbose);
+ }
+ asyncTest(() async {
+ List<Uri> uriList = <Uri>[];
+ Directory dir =
+ new Directory.fromUri(Uri.base.resolve('tests/compiler/dart2js/'));
+ for (FileSystemEntity entity in dir.listSync(recursive: true)) {
+ if (entity is File && entity.path.endsWith('.dart')) {
+ Uri file = Uri.base.resolve(nativeToUriPath(entity.path));
+ if (!SKIP_LIST.any((skip) => file.path.contains(skip))) {
+ uriList.add(file);
+ }
+ }
+ }
+ await analyze(uriList, WHITE_LIST, mode: AnalysisMode.URI);
+ });
+}
« no previous file with comments | « tests/compiler/dart2js/analyze_helper.dart ('k') | tests/compiler/dart2js/analyze_unused_dart2js_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698