@@ -142,7 +142,7 @@ Future<void> _processFile(File file,
142
142
bool insertCfe}) async {
143
143
stdout.write ("${file .path }..." );
144
144
var source = file.readAsStringSync ();
145
- var testFile = TestFile .parse (Path ("." ), file.path, source);
145
+ var testFile = TestFile .parse (Path ("." ), file.absolute. path, source);
146
146
147
147
var options = testFile.sharedOptions.toList ();
148
148
if (testFile.experiments.isNotEmpty) {
@@ -152,14 +152,14 @@ Future<void> _processFile(File file,
152
152
var errors = < StaticError > [];
153
153
if (insertAnalyzer) {
154
154
stdout.write ("\r ${file .path } (Running analyzer...)" );
155
- errors.addAll (await _runAnalyzer (file.path, options));
155
+ errors.addAll (await _runAnalyzer (file.absolute. path, options));
156
156
}
157
157
158
158
if (insertCfe) {
159
159
// Clear the previous line.
160
160
stdout.write ("\r ${file .path } " );
161
161
stdout.write ("\r ${file .path } (Running CFE...)" );
162
- errors.addAll (await _runCfe (file.path, options));
162
+ errors.addAll (await _runCfe (file.absolute. path, options));
163
163
}
164
164
165
165
errors = StaticError .simplify (errors);
@@ -182,11 +182,15 @@ Future<List<StaticError>> _runAnalyzer(
182
182
// TODO(rnystrom): Running the analyzer command line each time is very slow.
183
183
// Either import the analyzer as a library, or at least invoke it in a batch
184
184
// mode.
185
- var result = await Process .run ("sdk/bin/dartanalyzer$shellScriptExtension " , [
186
- ...options,
187
- "--format=machine" ,
188
- path,
189
- ]);
185
+ var result = await Process .run (
186
+ Platform .isWindows
187
+ ? "sdk\\ bin\\ dartanalyzer.bat"
188
+ : "sdk/bin/dartanalyzer" ,
189
+ [
190
+ ...options,
191
+ "--format=machine" ,
192
+ path,
193
+ ]);
190
194
var errors = < StaticError > [];
191
195
AnalysisCommandOutput .parseErrors (result.stderr as String , errors);
192
196
return errors;
@@ -197,19 +201,17 @@ Future<List<StaticError>> _runCfe(String path, List<String> options) async {
197
201
// TODO(rnystrom): Running the CFE command line each time is slow and wastes
198
202
// time generating code, which we don't care about. Import it as a library or
199
203
// at least run it in batch mode.
200
- var result = await Process .run ("sdk/bin/dart" , [
204
+ var result = await Process .run (
205
+ Platform .isWindows ? "sdk\\ bin\\ dart.bat" : "sdk/bin/dart" , [
201
206
"pkg/front_end/tool/_fasta/compile.dart" ,
202
207
...options,
203
208
"--verify" ,
209
+ "-o" ,
210
+ "dev:null" , // Output is only created for file URIs.
204
211
path,
205
212
]);
206
213
207
214
var errors = < StaticError > [];
208
215
FastaCommandOutput .parseErrors (result.stdout as String , errors);
209
-
210
- // Running the above command generates a dill file next to the test, which we
211
- // don't want, so delete it.
212
- await File ("$path .dill" ).delete ();
213
-
214
216
return errors;
215
217
}
0 commit comments