| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 summary_report; | 5 library summary_report; |
| 6 | 6 |
| 7 import "status_file_parser.dart"; | 7 import "status_file_parser.dart"; |
| 8 import "test_runner.dart"; | 8 import "test_runner.dart"; |
| 9 | 9 |
| 10 final summaryReport = new SummaryReport(); | 10 final summaryReport = new SummaryReport(); |
| 11 | 11 |
| 12 class SummaryReport { | 12 class SummaryReport { |
| 13 int _total = 0; | 13 int _total = 0; |
| 14 int _skipped = 0; | 14 int _skipped = 0; |
| 15 int _skippedByDesign = 0; | 15 int _skippedByDesign = 0; |
| 16 int _noCrash = 0; | 16 int _noCrash = 0; |
| 17 int _flakyCrash = 0; | 17 int _flakyCrash = 0; |
| 18 int _pass = 0; | 18 int _pass = 0; |
| 19 int _failOk = 0; | 19 int _failOk = 0; |
| 20 int _fail = 0; | 20 int _fail = 0; |
| 21 int _crash = 0; | 21 int _crash = 0; |
| 22 int _timeout = 0; | 22 int _timeout = 0; |
| 23 int _compileErrorSkip = 0; | 23 int _compileErrorSkip = 0; |
| 24 | 24 |
| 25 int get total => _total; | 25 int get total => _total; |
| 26 | 26 |
| 27 int get skippedOther => _skipped - _skippedByDesign; |
| 28 |
| 27 int get bogus => _nonStandardTestCases.length; | 29 int get bogus => _nonStandardTestCases.length; |
| 28 | 30 |
| 29 final List<TestCase> _nonStandardTestCases = <TestCase>[]; | 31 final List<TestCase> _nonStandardTestCases = <TestCase>[]; |
| 30 | 32 |
| 31 void add(TestCase testCase) { | 33 void add(TestCase testCase) { |
| 32 var expectations = testCase.expectedOutcomes; | 34 var expectations = testCase.expectedOutcomes; |
| 33 | 35 |
| 34 bool containsFail = expectations | 36 bool containsFail = expectations |
| 35 .any((expectation) => expectation.canBeOutcomeOf(Expectation.FAIL)); | 37 .any((expectation) => expectation.canBeOutcomeOf(Expectation.FAIL)); |
| 36 bool containsPass = expectations.contains(Expectation.PASS); | 38 bool containsPass = expectations.contains(Expectation.PASS); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 92 } |
| 91 } | 93 } |
| 92 } | 94 } |
| 93 | 95 |
| 94 void addCompileErrorSkipTest() { | 96 void addCompileErrorSkipTest() { |
| 95 _total++; | 97 _total++; |
| 96 _compileErrorSkip++; | 98 _compileErrorSkip++; |
| 97 } | 99 } |
| 98 | 100 |
| 99 Map<String, int> get values => { | 101 Map<String, int> get values => { |
| 100 'skipped': _skipped, | 102 'total': _total, |
| 103 'skippedOther': skippedOther, |
| 101 'skippedByDesign': _skippedByDesign, | 104 'skippedByDesign': _skippedByDesign, |
| 102 'pass': _pass, | 105 'pass': _pass, |
| 103 'noCrash': _noCrash, | 106 'noCrash': _noCrash, |
| 104 'flakyCrash': _flakyCrash, | 107 'flakyCrash': _flakyCrash, |
| 105 'failOk': _failOk, | 108 'failOk': _failOk, |
| 106 'fail': _fail, | 109 'fail': _fail, |
| 107 'crash': _crash, | 110 'crash': _crash, |
| 108 'timeout': _timeout, | 111 'timeout': _timeout, |
| 109 'compileErrorSkip': _compileErrorSkip, | 112 'compileErrorSkip': _compileErrorSkip, |
| 110 'bogus': bogus | 113 'bogus': bogus |
| (...skipping 10 matching lines...) Expand all Loading... |
| 121 * $_timeout tests are allowed to timeout | 124 * $_timeout tests are allowed to timeout |
| 122 * $_compileErrorSkip tests are skipped on browsers due to compile-time error | 125 * $_compileErrorSkip tests are skipped on browsers due to compile-time error |
| 123 * $bogus could not be categorized or are in multiple categories | 126 * $bogus could not be categorized or are in multiple categories |
| 124 """; | 127 """; |
| 125 | 128 |
| 126 void printReport() { | 129 void printReport() { |
| 127 if (_total == 0) return; | 130 if (_total == 0) return; |
| 128 print(report); | 131 print(report); |
| 129 } | 132 } |
| 130 } | 133 } |
| OLD | NEW |