| Index: pkg/status_file/test/repo_status_files_test.dart
|
| diff --git a/pkg/status_file/test/repo_status_files_test.dart b/pkg/status_file/test/repo_status_files_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ef4ae6d11ff76f03da1d29ef6cbc019a0ace0a71
|
| --- /dev/null
|
| +++ b/pkg/status_file/test/repo_status_files_test.dart
|
| @@ -0,0 +1,36 @@
|
| +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +/// Tests that every .status file in the Dart repository can be successfully
|
| +/// parsed.
|
| +import 'dart:io';
|
| +
|
| +import 'package:expect/expect.dart';
|
| +import 'package:path/path.dart' as p;
|
| +import 'package:status_file/status_file.dart';
|
| +
|
| +final repoRoot =
|
| + p.normalize(p.join(p.dirname(p.fromUri(Platform.script)), "../../../"));
|
| +
|
| +void main() {
|
| + // Parse every status file in the repository.
|
| + for (var directory in ["tests", p.join("runtime", "tests")]) {
|
| + for (var entry in new Directory(p.join(repoRoot, directory))
|
| + .listSync(recursive: true)) {
|
| + if (!entry.path.endsWith(".status")) continue;
|
| +
|
| + // Inside the co19 repository, there is a status file that doesn't appear
|
| + // to be valid and looks more like some kind of template or help document.
|
| + // Ignore it.
|
| + if (entry.path.endsWith(p.join("co19", "src", "co19.status"))) continue;
|
| +
|
| + try {
|
| + new StatusFile.read(entry.path);
|
| + } catch (err) {
|
| + var path = p.relative(entry.path, from: repoRoot);
|
| + Expect.fail("Could not parse '$path'.\n$err");
|
| + }
|
| + }
|
| + }
|
| +}
|
|
|