dart-sdk/tools/validate_test_matrix.dart
Alexander Thomas 44f3881be6 [infra] Update checked-in SDKs to 2.12.0-0.0.dev
This is the first checked-in SDK with null-safety enabled by default.

Change-Id: I8f6fcdfd8856483f4737eb200ed4623a244cb0cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170085
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2020-11-05 07:53:22 +00:00

29 lines
813 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();
var 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;
}
}