Index: tools/gardening/test/parse_build_results_test.dart |
diff --git a/tools/gardening/test/parse_build_results_test.dart b/tools/gardening/test/parse_build_results_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2d5ef3c03dbf7e2456ce8f365b1998fa03917dd9 |
--- /dev/null |
+++ b/tools/gardening/test/parse_build_results_test.dart |
@@ -0,0 +1,42 @@ |
+// 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. |
+ |
+import 'package:args/args.dart'; |
+import 'package:expect/expect.dart'; |
+import 'package:gardening/src/buildbot_structures.dart'; |
+import 'package:gardening/src/util.dart'; |
+ |
+import 'test_client.dart'; |
+ |
+// TODO(johnniwinther): Use 'package:testing' to run all tests. |
+main(List<String> args) async { |
+ ArgParser argParser = createArgParser(); |
+ argParser.addFlag('force', abbr: 'f'); |
+ ArgResults argResults = argParser.parse(args); |
+ processArgResults(argResults); |
+ |
+ TestClient client = new TestClient(force: argResults['force']); |
+ BuildUri buildUri = |
+ new BuildUri.fromUrl('https://build.chromium.org/p/client.dart/builders/' |
+ 'vm-kernel-linux-debug-x64-be/builds/1884/steps/' |
+ 'vm%20tests/logs/stdio'); |
+ BuildResult result = await client.readResult(buildUri); |
+ |
+ void checkTest(String testName, String expectedStatus) { |
+ TestStatus status; |
+ for (TestStatus s in result.results) { |
+ if (s.config.testName == testName) { |
+ status = s; |
+ break; |
+ } |
+ } |
+ Expect.isNotNull(status, "TestStatus for '$testName' not found."); |
+ Expect.equals( |
+ expectedStatus, status.status, "Unexpected status for '$testName'."); |
+ } |
+ |
+ checkTest('corelib/list_growable_test', 'pass'); |
+ checkTest('corelib_2/map_keys2_test', 'fail'); |
+ client.close(); |
+} |