| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 277     var expectations = | 277     var expectations = | 
| 278         test.expectedOutcomes.map((expectation) => "$expectation").toList(); | 278         test.expectedOutcomes.map((expectation) => "$expectation").toList(); | 
| 279 | 279 | 
| 280     var commandResults = []; | 280     var commandResults = []; | 
| 281     double totalDuration = 0.0; | 281     double totalDuration = 0.0; | 
| 282     for (var command in test.commands) { | 282     for (var command in test.commands) { | 
| 283       var output = test.commandOutputs[command]; | 283       var output = test.commandOutputs[command]; | 
| 284       if (output != null) { | 284       if (output != null) { | 
| 285         double duration = output.time.inMicroseconds / 1000.0; | 285         double duration = output.time.inMicroseconds / 1000.0; | 
| 286         totalDuration += duration; | 286         totalDuration += duration; | 
| 287         commandResults | 287         commandResults.add({ | 
| 288             .add({'name': command.displayName, 'duration': duration,}); | 288           'name': command.displayName, | 
|  | 289           'duration': duration, | 
|  | 290         }); | 
| 289       } | 291       } | 
| 290     } | 292     } | 
| 291     _writeTestOutcomeRecord({ | 293     _writeTestOutcomeRecord({ | 
| 292       'name': name, | 294       'name': name, | 
| 293       'configuration': configuration, | 295       'configuration': configuration, | 
| 294       'test_result': { | 296       'test_result': { | 
| 295         'outcome': outcome, | 297         'outcome': outcome, | 
| 296         'expected_outcomes': expectations, | 298         'expected_outcomes': expectations, | 
| 297         'duration': totalDuration, | 299         'duration': totalDuration, | 
| 298         'command_results': commandResults, | 300         'command_results': commandResults, | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
| 327       // archived by CoreDumpArchiver (see tools/utils.py). | 329       // archived by CoreDumpArchiver (see tools/utils.py). | 
| 328       // | 330       // | 
| 329       // For debugging purposes we need to archive the crashed binary as well. | 331       // For debugging purposes we need to archive the crashed binary as well. | 
| 330       // | 332       // | 
| 331       // To simplify the archiving code we simply copy binaries into current | 333       // To simplify the archiving code we simply copy binaries into current | 
| 332       // folder next to core dumps and name them | 334       // folder next to core dumps and name them | 
| 333       // `binary.${mode}_${arch}_${binary_name}`. | 335       // `binary.${mode}_${arch}_${binary_name}`. | 
| 334       final binName = lastCommand.executable; | 336       final binName = lastCommand.executable; | 
| 335       final binFile = new File(binName); | 337       final binFile = new File(binName); | 
| 336       final binBaseName = new Path(binName).filename; | 338       final binBaseName = new Path(binName).filename; | 
| 337       if (!archivedBinaries.containsKey(binName) && | 339       if (!archivedBinaries.containsKey(binName) && binFile.existsSync()) { | 
| 338           binFile.existsSync()) { |  | 
| 339         final mode = test.configuration['mode']; | 340         final mode = test.configuration['mode']; | 
| 340         final arch = test.configuration['arch']; | 341         final arch = test.configuration['arch']; | 
| 341         final archived = "binary.${mode}_${arch}_${binBaseName}"; | 342         final archived = "binary.${mode}_${arch}_${binBaseName}"; | 
| 342         TestUtils.copyFile(new Path(binName), new Path(archived)); | 343         TestUtils.copyFile(new Path(binName), new Path(archived)); | 
| 343         archivedBinaries[binName] = archived; | 344         archivedBinaries[binName] = archived; | 
| 344       } | 345       } | 
| 345 | 346 | 
| 346       if (archivedBinaries.containsKey(binName)) { | 347       if (archivedBinaries.containsKey(binName)) { | 
| 347         // We have found and copied the binary. | 348         // We have found and copied the binary. | 
| 348         var unexpectedCrashesFile; | 349         var unexpectedCrashesFile; | 
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 716       return new VerboseProgressIndicator(startTime); | 717       return new VerboseProgressIndicator(startTime); | 
| 717     case 'status': | 718     case 'status': | 
| 718       return new ProgressIndicator(startTime); | 719       return new ProgressIndicator(startTime); | 
| 719     case 'buildbot': | 720     case 'buildbot': | 
| 720       return new BuildbotProgressIndicator(startTime); | 721       return new BuildbotProgressIndicator(startTime); | 
| 721     default: | 722     default: | 
| 722       assert(false); | 723       assert(false); | 
| 723       return null; | 724       return null; | 
| 724   } | 725   } | 
| 725 } | 726 } | 
| OLD | NEW | 
|---|