mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 09:43:08 +00:00
052c642151
This change adds a rule to the SDK PRESUBMIT.py to validate that the test matrix used by the CI/CQ builders does not contain errors. Change-Id: Ie967e71dda76677f4db84c1e9e613d702b57069f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147547 Commit-Queue: Karl Klose <karlklose@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
26 lines
797 B
Dart
26 lines
797 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.
|
|
|
|
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;
|
|
}
|
|
}
|