Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: expect_tests/handle_list.py

Issue 412773002: Copy expect_tests from build (Closed) Base URL: https://chromium.googlesource.com/infra/testing/expect_tests@master
Patch Set: Fancy ast walker Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « expect_tests/handle_debug.py ('k') | expect_tests/handle_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: expect_tests/handle_list.py
diff --git a/expect_tests/handle_list.py b/expect_tests/handle_list.py
new file mode 100644
index 0000000000000000000000000000000000000000..da17e5d3fbf89ab430fc0be748972f8fa204ee15
--- /dev/null
+++ b/expect_tests/handle_list.py
@@ -0,0 +1,33 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from expect_tests.type_definitions import Handler
+
+
+class ListHandler(Handler):
+ """List all of the tests instead of running them."""
+ SKIP_RUNLOOP = True
+
+ # Used to collect all bare test names for command line test name completion.
+ COMPLETION_LIST = None
+
+ class ResultStageHandler(Handler.ResultStageHandler):
+ @staticmethod
+ def handle_Test(test):
+ if ListHandler.COMPLETION_LIST is not None:
+ ListHandler.COMPLETION_LIST.append(test.name)
+ else:
+ print test.name
+
+ @staticmethod
+ def handle_MultiTest(multi_test):
+ print 'MultiTest(%r, atomic=%r)' % (multi_test.name, multi_test.atomic)
+ for test in multi_test.tests:
+ if ListHandler.COMPLETION_LIST is not None:
+ ListHandler.COMPLETION_LIST.append(test.name)
+ else:
+ print '|', test.name
+
+ # TODO(iannucci): group tests by dir?
+ # TODO(iannucci): print more data about the test in verbose mode?
« no previous file with comments | « expect_tests/handle_debug.py ('k') | expect_tests/handle_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698