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

Side by Side Diff: packages/analyzer/test/src/task/test_support.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « packages/analyzer/test/src/task/test_all.dart ('k') | packages/analyzer/test/src/test_all.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, 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 test.src.task.test_support;
6
7 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
8 import 'package:analyzer/src/generated/java_engine.dart';
9 import 'package:analyzer/task/model.dart';
10
11 /**
12 * A configurable analysis task that can be used by tests.
13 */
14 class TestAnalysisTask extends AnalysisTask {
15 /**
16 * The descriptor describing this task.
17 */
18 TaskDescriptor descriptor;
19
20 /**
21 * The exception that is to be "thrown" by this task.
22 */
23 CaughtException exception;
24
25 /**
26 * The results whose values are to be provided as outputs from this task.
27 */
28 List<ResultDescriptor> results;
29
30 /**
31 * The next value that is to be used for a result.
32 */
33 int value;
34
35 @override
36 final bool handlesDependencyCycles;
37
38 TestAnalysisTask(AnalysisContext context, AnalysisTarget target,
39 {this.descriptor,
40 this.exception,
41 this.handlesDependencyCycles: false,
42 this.results,
43 this.value: 1})
44 : super(context, target);
45
46 @override
47 String get description => 'Test task';
48
49 @override
50 internalPerform() {
51 if (exception != null) {
52 caughtException = exception;
53 } else if (results != null) {
54 for (ResultDescriptor result in results) {
55 outputs[result] = value++;
56 }
57 } else if (descriptor != null) {
58 for (ResultDescriptor result in descriptor.results) {
59 outputs[result] = value++;
60 }
61 }
62 }
63 }
OLDNEW
« no previous file with comments | « packages/analyzer/test/src/task/test_all.dart ('k') | packages/analyzer/test/src/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698