| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for executing tests. | 6 * Classes and methods for executing tests. |
| 7 * | 7 * |
| 8 * This module includes: | 8 * This module includes: |
| 9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
| 10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 List<String> staticWarnings = []; | 841 List<String> staticWarnings = []; |
| 842 | 842 |
| 843 // Read the returned list of errors and stuff them away. | 843 // Read the returned list of errors and stuff them away. |
| 844 var stderrLines = decodeUtf8(super.stderr).split("\n"); | 844 var stderrLines = decodeUtf8(super.stderr).split("\n"); |
| 845 for (String line in stderrLines) { | 845 for (String line in stderrLines) { |
| 846 if (line.length == 0) continue; | 846 if (line.length == 0) continue; |
| 847 List<String> fields = splitMachineError(line); | 847 List<String> fields = splitMachineError(line); |
| 848 if (fields[ERROR_LEVEL] == 'ERROR') { | 848 if (fields[ERROR_LEVEL] == 'ERROR') { |
| 849 errors.add(fields[FORMATTED_ERROR]); | 849 errors.add(fields[FORMATTED_ERROR]); |
| 850 } else if (fields[ERROR_LEVEL] == 'WARNING') { | 850 } else if (fields[ERROR_LEVEL] == 'WARNING') { |
| 851 // We only care about testing Static type warnings | 851 staticWarnings.add(fields[FORMATTED_ERROR]); |
| 852 // ignore all others | |
| 853 if (fields[ERROR_TYPE] == 'STATIC_TYPE' || fields[ERROR_TYPE] == 'STATIC
_TYPE_WARNING') { | |
| 854 staticWarnings.add(fields[FORMATTED_ERROR]); | |
| 855 } | |
| 856 } | 852 } |
| 857 // OK to Skip error output that doesn't match the machine format | 853 // OK to Skip error output that doesn't match the machine format |
| 858 } | 854 } |
| 859 if (testCase.info != null | 855 if (testCase.info != null |
| 860 && testCase.info.optionsFromFile['isMultitest']) { | 856 && testCase.info.optionsFromFile['isMultitest']) { |
| 861 return _didMultitestFail(errors, staticWarnings); | 857 return _didMultitestFail(errors, staticWarnings); |
| 862 } | 858 } |
| 863 return _didStandardTestFail(errors, staticWarnings); | 859 return _didStandardTestFail(errors, staticWarnings); |
| 864 } | 860 } |
| 865 | 861 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 diagnostics.add(" command[0]:${testCase.commands[0]}"); | 908 diagnostics.add(" command[0]:${testCase.commands[0]}"); |
| 913 diagnostics.add(" exitCode:${exitCode}"); | 909 diagnostics.add(" exitCode:${exitCode}"); |
| 914 return true; | 910 return true; |
| 915 } | 911 } |
| 916 if (numStaticTypeAnnotations > 0 && isStaticClean) { | 912 if (numStaticTypeAnnotations > 0 && isStaticClean) { |
| 917 diagnostics.add("Cannot have both @static-clean and /// static " | 913 diagnostics.add("Cannot have both @static-clean and /// static " |
| 918 "type warning annotations."); | 914 "type warning annotations."); |
| 919 return true; | 915 return true; |
| 920 } | 916 } |
| 921 | 917 |
| 922 if (isStaticClean && staticWarnings.length > 0) { | 918 if (isStaticClean && (errors.isNotEmpty || staticWarnings.isNotEmpty)) { |
| 923 diagnostics.add( | 919 diagnostics.add( |
| 924 "@static-clean annotation found but analyzer returned warnings."); | 920 "@static-clean annotation found but analyzer returned problems."); |
| 925 return true; | 921 return true; |
| 926 } | 922 } |
| 927 | 923 |
| 928 if (numCompileTimeAnnotations > 0 | 924 if (numCompileTimeAnnotations > 0 |
| 929 && numCompileTimeAnnotations < errors.length) { | 925 && numCompileTimeAnnotations < errors.length) { |
| 930 // Expected compile-time errors were not returned. | 926 // Expected compile-time errors were not returned. |
| 931 // The test did not 'fail' in the way intended so don't return failed. | 927 // The test did not 'fail' in the way intended so don't return failed. |
| 932 diagnostics.add("Fewer compile time errors than annotated: " | 928 diagnostics.add("Fewer compile time errors than annotated: " |
| 933 "$numCompileTimeAnnotations"); | 929 "$numCompileTimeAnnotations"); |
| 934 return false; | 930 return false; |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 } | 1920 } |
| 1925 } | 1921 } |
| 1926 | 1922 |
| 1927 void eventAllTestsDone() { | 1923 void eventAllTestsDone() { |
| 1928 for (var listener in _eventListener) { | 1924 for (var listener in _eventListener) { |
| 1929 listener.allDone(); | 1925 listener.allDone(); |
| 1930 } | 1926 } |
| 1931 } | 1927 } |
| 1932 } | 1928 } |
| 1933 | 1929 |
| OLD | NEW |