dart-sdk/tools/validate_test_matrix.dart
Devon Carew c4dc032f6c [repo] improve the analysis of the tools/ directory
Change-Id: I4185e3bdc1f0f6f8464ebc2a043254200e3df486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233502
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-02-17 19:09:52 +00:00

30 lines
831 B
Dart

// Copyright (c) 2020, 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.
// Test that the test matrix in the SDK can be parsed correctly.
// @dart = 2.9
import 'dart:convert' show jsonDecode;
import 'dart:io' show File, Platform;
import 'package:smith/smith.dart' show TestMatrix;
main() {
var path = Platform.script.resolve("bots/test_matrix.json").toFilePath();
Map<String, dynamic> json;
try {
json = jsonDecode(File(path).readAsStringSync());
} catch (e) {
print("The test matrix at $path is not valid JSON!\n\n$e");
return;
}
try {
TestMatrix.fromJson(json);
} catch (e) {
print("The test matrix at $path is invalid!\n\n$e");
return;
}
}