25af9c2495
This is a branch of co19 tests where the tests have been made strong mode compliant. A co19_2_analyzer.status file has been added with the current statuses of the tests when run on dartanalyzer --strong. We expect more Dart 2 configurations to start running these tests and adding status files. Change-Id: I22077272707620b92dd1092c38bbb4f3d5964493 Reviewed-on: https://dart-review.googlesource.com/37743 Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
42 lines
1.5 KiB
Dart
42 lines
1.5 KiB
Dart
// 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:status_file/canonical_status_file.dart';
|
|
|
|
final Uri repoRoot = Platform.script.resolve("../../../");
|
|
|
|
void main() {
|
|
// Parse every status file in the repository.
|
|
for (var directory in ["tests", "runtime/tests"]) {
|
|
for (var entry in new Directory.fromUri(repoRoot.resolve(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.
|
|
var co19StatusFile = repoRoot.resolve('tests/co19/src/co19.status');
|
|
var co19_2StatusFile = repoRoot.resolve('tests/co19_2/src/co19.status');
|
|
if (FileSystemEntity.identicalSync(
|
|
entry.path, new File.fromUri(co19StatusFile).path) ||
|
|
FileSystemEntity.identicalSync(
|
|
entry.path, new File.fromUri(co19_2StatusFile).path)) {
|
|
continue;
|
|
}
|
|
|
|
try {
|
|
var statusFile = new StatusFile.read(entry.path);
|
|
statusFile.toString();
|
|
} catch (err, st) {
|
|
print(err);
|
|
print(st);
|
|
throw new Exception("Could not parse '${entry.path}'.\n$err");
|
|
}
|
|
}
|
|
}
|
|
}
|