| 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 * Tool for identifying stale test lines. Used when updating co19. | 6 * Tool for identifying stale test lines. Used when updating co19. |
| 7 * | 7 * |
| 8 * Usage: | 8 * Usage: |
| 9 * [: ./tools/testing/bin/$OS/dart tools/testing/dart/scrub_status_file.dart :] | 9 * [: ./tools/testing/bin/$OS/dart tools/testing/dart/scrub_status_file.dart :] |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 // TODO(ahe): Consider generalizing this. | 12 // TODO(ahe): Consider generalizing this. |
| 13 | 13 |
| 14 #import('dart:io'); | 14 #import('dart:io'); |
| 15 | 15 |
| 16 #import('status_file_parser.dart'); | 16 #import('status_file_parser.dart'); |
| 17 | 17 |
| 18 const List<String> CO19_STATUS_FILES = const <String>[ | 18 const List<String> CO19_STATUS_FILES = const <String>[ |
| 19 'tests/co19/co19-compiler.status', | 19 'tests/co19/co19-compiler.status', |
| 20 'tests/co19/co19-dart2dart.status', |
| 20 'tests/co19/co19-dart2js.status', | 21 'tests/co19/co19-dart2js.status', |
| 21 'tests/co19/co19-runtime.status']; | 22 'tests/co19/co19-runtime.status']; |
| 22 | 23 |
| 23 void onSectionsRead(String statusFile, List sections) { | 24 void onSectionsRead(String statusFile, List sections) { |
| 24 for (var section in sections) { | 25 for (var section in sections) { |
| 25 for (var rule in section.testRules) { | 26 for (var rule in section.testRules) { |
| 26 String name = rule.name; | 27 String name = rule.name; |
| 27 if (name == '*') continue; | 28 if (name == '*') continue; |
| 28 String path = 'tests/co19/src/$name.dart'; | 29 String path = 'tests/co19/src/$name.dart'; |
| 29 File file = new File(path); | 30 File file = new File(path); |
| 30 if (!file.existsSync()) { | 31 if (!file.existsSync()) { |
| 31 print('$statusFile: $path: no such file'); | 32 print('$statusFile: $path: no such file'); |
| 32 } | 33 } |
| 33 } | 34 } |
| 34 } | 35 } |
| 35 } | 36 } |
| 36 | 37 |
| 37 void readStatusFile(String path) { | 38 void readStatusFile(String path) { |
| 38 var sections = []; | 39 var sections = []; |
| 39 ReadConfigurationInto(path, | 40 ReadConfigurationInto(path, |
| 40 sections, | 41 sections, |
| 41 () => onSectionsRead(path, sections)); | 42 () => onSectionsRead(path, sections)); |
| 42 } | 43 } |
| 43 | 44 |
| 44 void main() { | 45 void main() { |
| 45 CO19_STATUS_FILES.forEach(readStatusFile); | 46 CO19_STATUS_FILES.forEach(readStatusFile); |
| 46 } | 47 } |
| OLD | NEW |