Index: mojo/tools/test_runner.py |
diff --git a/mojo/tools/test_runner.py b/mojo/tools/test_runner.py |
index 27fe1fa8b20a28619e91f29d580934a7cd0390cf..269fe36ad98601c26a2dfe9f1995f155686b17d2 100755 |
--- a/mojo/tools/test_runner.py |
+++ b/mojo/tools/test_runner.py |
@@ -6,6 +6,7 @@ |
"""A "smart" test runner for gtest unit tests (that caches successes).""" |
import argparse |
+import json |
import logging |
import os |
import platform |
@@ -42,8 +43,9 @@ def main(): |
_logging.debug("Test list file: %s", args.gtest_list_file) |
with open(args.gtest_list_file, 'rb') as f: |
- gtest_list = [y for y in [x.strip() for x in f.readlines()] \ |
- if y and y[0] != '#'] |
+ stripped_file = ''.join( |
+ [l for l in f.readlines() if not l.lstrip().startswith('#')]) |
viettrungluu
2014/12/03 16:15:37
I see.
Rather than doing something weird, why don
qsr
2014/12/03 16:38:32
Done.
|
+ gtest_list = json.loads(stripped_file) |
_logging.debug("Test list: %s" % gtest_list) |
print "Running tests in directory: %s" % args.root_dir |
@@ -78,13 +80,16 @@ def main(): |
# TODO(vtl): We may not close this file on failure. |
successes_cache_file = open(args.successes_cache_filename, 'ab') \ |
if args.successes_cache_filename else None |
- for gtest in gtest_list: |
- if gtest[0] == '*': |
- gtest = gtest[1:] |
+ for gtest_dict in gtest_list: |
+ if gtest_dict.get("disabled"): |
+ continue |
+ if args.android and not gtest_dict.get("run_on_android"): |
viettrungluu
2014/12/03 16:15:37
Having arbitrary/hacky entries like run_on_android
|
+ continue |
+ |
+ gtest = gtest_dict["test"] |
+ cacheable = gtest_dict.get("cacheable", True) |
+ if not cacheable: |
_logging.debug("%s is marked as non-cacheable" % gtest) |
- cacheable = False |
- else: |
- cacheable = True |
gtest_file = gtest |
if platform.system() == 'Windows': |