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

Unified Diff: mojo/tools/test_runner.py

Issue 780563002: Update unit test file format. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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
« mojo/tools/data/unittests ('K') | « mojo/tools/get_test_list.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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':
« mojo/tools/data/unittests ('K') | « mojo/tools/get_test_list.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698