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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dart2js.analyze_test.test;
6
7 import 'dart:io';
8
9 import 'package:async_helper/async_helper.dart';
10 import 'package:compiler/src/apiimpl.dart' show
sigurdm 2016/01/06 12:34:44 Nit: unused import
11 CompilerImpl;
12 import 'package:compiler/src/commandline_options.dart';
13 import 'package:compiler/src/diagnostics/messages.dart' show
14 MessageKind;
15 import 'package:compiler/src/filenames.dart' show
16 nativeToUriPath;
17
18 import 'analyze_helper.dart';
19 import 'memory_compiler.dart';
20
21 /**
22 * Map of white-listed warnings and errors.
23 *
24 * Use an identifiable suffix of the file uri as key. Use a fixed substring of
25 * the error/warning message in the list of white-listings for each file.
26 */
27 // TODO(johnniwinther): Support canonical URIs as keys and message kinds as
28 // values.
29 const Map<String, List/*<String|MessageKind>*/> WHITE_LIST = const {
30 "analyze_all_test.dart": const [
31 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
32 ],
33 "/test/src/util/": const [
34 "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
35 "'ForkableStream' declaration.",
36 ],
37 "mirrors_test.dart": const [
38 MessageKind.INVALID_SYMBOL,
39 MessageKind.PRIVATE_IDENTIFIER,
40 ],
41 };
42
43 const List<String> SKIP_LIST = const <String>[
44 // Helper files:
45 "dart2js_batch2_run.dart",
46 "http_launch_data/",
47 "mirrors_helper.dart",
48 "path%20with%20spaces/",
49 "one_line_dart_program.dart",
50 "sourcemaps/invokes_test_file.dart",
51 // No longer maintained:
52 "backend_dart/",
53 // Broken tests:
54 "http_test.dart",
55 ];
56
57 main(List<String> arguments) {
58 bool verbose = arguments.contains('-v');
59
60 List<String> options = <String>[
61 Flags.analyzeOnly,
62 Flags.analyzeMain,
63 '--categories=Client,Server'];
64 if (verbose) {
65 options.add(Flags.verbose);
66 }
67 asyncTest(() async {
68 List<Uri> uriList = <Uri>[];
69 Directory dir =
70 new Directory.fromUri(Uri.base.resolve('tests/compiler/dart2js/'));
71 for (FileSystemEntity entity in dir.listSync(recursive: true)) {
72 if (entity is File && entity.path.endsWith('.dart')) {
73 Uri file = Uri.base.resolve(nativeToUriPath(entity.path));
74 if (!SKIP_LIST.any((skip) => file.path.contains(skip))) {
75 uriList.add(file);
76 }
77 }
78 }
79 await analyze(uriList, WHITE_LIST, mode: AnalysisMode.URI);
80 });
81 }
OLDNEW
« 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