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

Unified Diff: pkg/analyzer/lib/src/task/driver.dart

Issue 1007993002: Use AnalysisDriver to run task tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « no previous file | pkg/analyzer/test/src/mock_sdk.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/driver.dart
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index 0ad41bbc8e54a8298bdfc297a8551d598f21ba85..91d7d3fc2be51a917b770bc7b505c8598094cd46 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -66,15 +66,17 @@ class AnalysisDriver {
/**
* Perform work until the given [result] has been computed for the given
- * [target].
+ * [target]. Return the last [AnalysisTask] that was performed.
*/
- void computeResult(AnalysisTarget target, ResultDescriptor result) {
+ AnalysisTask computeResult(AnalysisTarget target, ResultDescriptor result) {
+ AnalysisTask task;
WorkOrder workOrder = createWorkOrderForResult(target, result);
if (workOrder != null) {
while (workOrder.moveNext()) {
- performWorkItem(workOrder.current);
+ task = performWorkItem(workOrder.current);
}
}
+ return task;
}
/**
@@ -185,14 +187,15 @@ class AnalysisDriver {
/**
* Perform the given work item.
+ * Return the performed [AnalysisTask].
*/
- void performWorkItem(WorkItem item) {
+ AnalysisTask performWorkItem(WorkItem item) {
if (item.exception != null) {
// Mark all of the results that the task would have computed as being in
// ERROR with the exception recorded on the work item.
CacheEntry targetEntry = context.getCacheEntry(item.target);
targetEntry.setErrorState(item.exception, item.descriptor.results);
- return;
+ return null;
}
// Otherwise, perform the task.
AnalysisTask task = item.buildTask();
@@ -210,6 +213,7 @@ class AnalysisDriver {
entry.setErrorState(task.caughtException, item.descriptor.results);
}
_onTaskCompletedController.add(task);
+ return task;
}
/**
« no previous file with comments | « no previous file | pkg/analyzer/test/src/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698