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:async"; | 7 import "dart:async"; |
8 import "dart:io"; | 8 import "dart:io"; |
9 import "dart:io" as io; | 9 import "dart:io" as io; |
10 import "dart:convert" show JSON; | 10 import "dart:convert" show JSON; |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 .openWrite(mode: FileMode.APPEND); | 312 .openWrite(mode: FileMode.APPEND); |
313 } | 313 } |
314 _sink.write("${JSON.encode(record)}\n"); | 314 _sink.write("${JSON.encode(record)}\n"); |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 class UnexpectedCrashDumpArchiver extends EventListener { | 318 class UnexpectedCrashDumpArchiver extends EventListener { |
319 final archivedBinaries = new Set<String>(); | 319 final archivedBinaries = new Set<String>(); |
320 | 320 |
321 void done(TestCase test) { | 321 void done(TestCase test) { |
322 if (test.unexpectedOutput && test.result == Expectation.CRASH) { | 322 if (test.unexpectedOutput && |
| 323 test.result == Expectation.CRASH && |
| 324 test.lastCommandExecuted is ProcessCommand) { |
323 final name = "core.${test.lastCommandOutput.pid}"; | 325 final name = "core.${test.lastCommandOutput.pid}"; |
324 final file = new File(name); | 326 final file = new File(name); |
325 final exists = file.existsSync(); | 327 final exists = file.existsSync(); |
326 if (exists) { | 328 if (exists) { |
| 329 final lastCommand = test.lastCommandExecuted as ProcessCommand; |
327 // We have a coredump for the process. This coredump will be archived by | 330 // We have a coredump for the process. This coredump will be archived by |
328 // CoreDumpArchiver (see tools/utils.py). For debugging purposes we | 331 // CoreDumpArchiver (see tools/utils.py). For debugging purposes we |
329 // need to archive the crashed binary as well. To simplify the | 332 // need to archive the crashed binary as well. To simplify the |
330 // archiving code we simply copy binaries into current folder next to | 333 // archiving code we simply copy binaries into current folder next to |
331 // core dumps and name them `core.${mode}_${arch}_${binary_name}`. | 334 // core dumps and name them `core.${mode}_${arch}_${binary_name}`. |
332 final binName = test.lastCommandExecuted.executable; | 335 final binName = lastCommand.executable; |
333 final binFile = new File(binName); | 336 final binFile = new File(binName); |
334 final binBaseName = new Path(binName).filename; | 337 final binBaseName = new Path(binName).filename; |
335 if (archivedBinaries.contains(binBaseName)) { | 338 if (archivedBinaries.contains(binBaseName)) { |
336 return; | 339 return; |
337 } | 340 } |
338 | 341 |
339 if (binFile.existsSync()) { | 342 if (binFile.existsSync()) { |
340 final mode = test.configuration['mode']; | 343 final mode = test.configuration['mode']; |
341 final arch = test.configuration['arch']; | 344 final arch = test.configuration['arch']; |
342 TestUtils.copyFile(new Path(binName), | 345 TestUtils.copyFile(new Path(binName), |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 return new VerboseProgressIndicator(startTime); | 700 return new VerboseProgressIndicator(startTime); |
698 case 'status': | 701 case 'status': |
699 return new ProgressIndicator(startTime); | 702 return new ProgressIndicator(startTime); |
700 case 'buildbot': | 703 case 'buildbot': |
701 return new BuildbotProgressIndicator(startTime); | 704 return new BuildbotProgressIndicator(startTime); |
702 default: | 705 default: |
703 assert(false); | 706 assert(false); |
704 return null; | 707 return null; |
705 } | 708 } |
706 } | 709 } |
OLD | NEW |