Index: pkg/analyzer/lib/src/dart/sdk/sdk.dart |
diff --git a/pkg/analyzer/lib/src/dart/sdk/sdk.dart b/pkg/analyzer/lib/src/dart/sdk/sdk.dart |
index 303e6a49f917532b809816a197506a967fce831c..fc1a2d3c7493611163430792533bcf21a3701515 100644 |
--- a/pkg/analyzer/lib/src/dart/sdk/sdk.dart |
+++ b/pkg/analyzer/lib/src/dart/sdk/sdk.dart |
@@ -698,7 +698,16 @@ class FolderBasedDartSdk extends AbstractDartSdk { |
String outDir = pathContext.dirname(pathContext.dirname(exec)); |
String sdkPath = pathContext.join(pathContext.dirname(outDir), "sdk"); |
if (resourceProvider.getFolder(sdkPath).exists) { |
- return sdkPath; |
+ // We are executing in the context of a test. sdkPath is the path to the |
+ // *source* files for the SDK. But we want to test using the path to the |
+ // *built* SDK if possible. |
+ String builtSdkPath = |
+ pathContext.join(pathContext.dirname(exec), 'dart-sdk'); |
+ if (resourceProvider.getFolder(sdkPath).exists) { |
zra
2016/12/12 19:16:17
Shouldn't this be checking the existence of buildS
Paul Berry
2016/12/12 19:24:39
Yes, I just noticed this as well. Thanks.
Paul Berry
2016/12/12 19:27:50
Fix is here: https://codereview.chromium.org/25682
|
+ return builtSdkPath; |
+ } else { |
+ return sdkPath; |
+ } |
} |
// probably be "dart-sdk/bin/dart" |
return pathContext.dirname(pathContext.dirname(exec)); |