Skip to content

Commit f602d36

Browse files
author
Eric Seidel
committed
pub run test fails if dart is not in your path
These also might fail if the `dart` in your path was of a different version than you expected. This happens with Flutter since flutter downloads its own copy of the Dart SDK which may be differnt from the one installed globally on your disk. In my case, I just was using an explicit path to `pub` for `pub run test` and was surprised to see test failures. @keertip
1 parent 5b93362 commit f602d36

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/compare_output_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ void main() {
6060
tempDir.path
6161
];
6262

63-
var result =
64-
Process.runSync('dart', args, workingDirectory: _testPackagePath);
63+
var result = Process.runSync(Platform.resolvedExecutable, args,
64+
workingDirectory: _testPackagePath);
6565

6666
if (result.exitCode != 0) {
6767
print(result.exitCode);
@@ -129,8 +129,8 @@ void main() {
129129
tempDir.path
130130
];
131131

132-
var result =
133-
Process.runSync('dart', args, workingDirectory: _testPackagePath);
132+
var result = Process.runSync(Platform.resolvedExecutable, args,
133+
workingDirectory: _testPackagePath);
134134

135135
if (result.exitCode != 0) {
136136
print(result.exitCode);

tool/grind.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Future buildSdkDocs() async {
144144
delete(docsDir);
145145
log('building SDK docs');
146146
int sdkDocsGenTime = await _runAsyncTimed(() async {
147-
var process = await Process.start('dart', [
147+
var process = await Process.start(Platform.resolvedExecutable, [
148148
'bin/dartdoc.dart',
149149
'--output',
150150
'${docsDir.path}',

0 commit comments

Comments
 (0)