OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 /// Tests that every .status file in the Dart repository can be successfully |
| 6 /// parsed. |
| 7 import 'dart:io'; |
| 8 |
| 9 import 'package:expect/expect.dart'; |
| 10 import 'package:path/path.dart' as p; |
| 11 import 'package:status_file/status_file.dart'; |
| 12 |
| 13 final repoRoot = |
| 14 p.normalize(p.join(p.dirname(p.fromUri(Platform.script)), "../../../")); |
| 15 |
| 16 void main() { |
| 17 // Parse every status file in the repository. |
| 18 for (var directory in ["tests", p.join("runtime", "tests")]) { |
| 19 for (var entry in new Directory(p.join(repoRoot, directory)) |
| 20 .listSync(recursive: true)) { |
| 21 if (!entry.path.endsWith(".status")) continue; |
| 22 |
| 23 // Inside the co19 repository, there is a status file that doesn't appear |
| 24 // to be valid and looks more like some kind of template or help document. |
| 25 // Ignore it. |
| 26 if (entry.path.endsWith(p.join("co19", "src", "co19.status"))) continue; |
| 27 |
| 28 try { |
| 29 new StatusFile.read(entry.path); |
| 30 } catch (err) { |
| 31 var path = p.relative(entry.path, from: repoRoot); |
| 32 Expect.fail("Could not parse '$path'.\n$err"); |
| 33 } |
| 34 } |
| 35 } |
| 36 } |
OLD | NEW |