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

Unified Diff: test/codegen_test.dart

Issue 1949933002: Write .err file alongside .txt if no .js (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen_test.dart
diff --git a/test/codegen_test.dart b/test/codegen_test.dart
index 440a3fcaf0cc74b65f63aff7a4355f032416f33c..52dd5858b74c46873195821dbfdb75c3f88b7c09 100644
--- a/test/codegen_test.dart
+++ b/test/codegen_test.dart
@@ -121,8 +121,9 @@ main(arguments) {
void _writeModule(String outPath, JSModuleFile result) {
new Directory(path.dirname(outPath)).createSync(recursive: true);
- result.errors.add(''); // for trailing newline
- new File(outPath + '.txt').writeAsStringSync(result.errors.join('\n'));
+ String errors = result.errors.join('\n');
+ if (errors.isNotEmpty && !errors.endsWith('\n')) errors += '\n';
+ new File(outPath + '.txt').writeAsStringSync(errors);
if (result.isValid) {
new File(outPath + '.js').writeAsStringSync(result.code);
@@ -131,6 +132,9 @@ void _writeModule(String outPath, JSModuleFile result) {
new File(mapPath)
.writeAsStringSync(JSON.encode(result.placeSourceMap(mapPath)));
}
+ } else {
+ // Also write the errors to a '.err' file for easy counting.
+ new File(outPath + '.err').writeAsStringSync(errors);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698