OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test_progress; | 5 library test_progress; |
6 | 6 |
7 import "dart:convert" show JSON; | 7 import "dart:convert" show JSON; |
8 import "dart:io"; | 8 import "dart:io"; |
9 | 9 |
10 import "path.dart"; | 10 import "path.dart"; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (!archivedBinaries.containsKey(binName) && binFile.existsSync()) { | 226 if (!archivedBinaries.containsKey(binName) && binFile.existsSync()) { |
227 final mode = test.configuration['mode']; | 227 final mode = test.configuration['mode']; |
228 final arch = test.configuration['arch']; | 228 final arch = test.configuration['arch']; |
229 final archived = "binary.${mode}_${arch}_${binBaseName}"; | 229 final archived = "binary.${mode}_${arch}_${binBaseName}"; |
230 TestUtils.copyFile(new Path(binName), new Path(archived)); | 230 TestUtils.copyFile(new Path(binName), new Path(archived)); |
231 archivedBinaries[binName] = archived; | 231 archivedBinaries[binName] = archived; |
232 } | 232 } |
233 | 233 |
234 if (archivedBinaries.containsKey(binName)) { | 234 if (archivedBinaries.containsKey(binName)) { |
235 // We have found and copied the binary. | 235 // We have found and copied the binary. |
236 var unexpectedCrashesFile; | 236 RandomAccessFile unexpectedCrashesFile; |
237 try { | 237 try { |
238 unexpectedCrashesFile = | 238 unexpectedCrashesFile = |
239 new File('unexpected-crashes').openSync(mode: FileMode.APPEND); | 239 new File('unexpected-crashes').openSync(mode: FileMode.APPEND); |
240 unexpectedCrashesFile.writeStringSync( | 240 unexpectedCrashesFile.writeStringSync( |
241 "${test.displayName},${pid},${archivedBinaries[binName]}\n"); | 241 "${test.displayName},${pid},${archivedBinaries[binName]}\n"); |
242 } catch (e) { | 242 } catch (e) { |
243 print('Failed to add crash to unexpected-crashes list: ${e}'); | 243 print('Failed to add crash to unexpected-crashes list: ${e}'); |
244 } finally { | 244 } finally { |
245 try { | 245 try { |
246 if (unexpectedCrashesFile != null) { | 246 if (unexpectedCrashesFile != null) { |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 String _buildSummaryEnd(int failedTests) { | 675 String _buildSummaryEnd(int failedTests) { |
676 if (failedTests == 0) { | 676 if (failedTests == 0) { |
677 return '\n===\n=== All tests succeeded\n===\n'; | 677 return '\n===\n=== All tests succeeded\n===\n'; |
678 } else { | 678 } else { |
679 var pluralSuffix = failedTests != 1 ? 's' : ''; | 679 var pluralSuffix = failedTests != 1 ? 's' : ''; |
680 return '\n===\n=== ${failedTests} test$pluralSuffix failed\n===\n'; | 680 return '\n===\n=== ${failedTests} test$pluralSuffix failed\n===\n'; |
681 } | 681 } |
682 } | 682 } |
OLD | NEW |