summaryrefslogtreecommitdiffstats
path: root/mojo/tools
diff options
context:
space:
mode:
authormsw <msw@chromium.org>2015-06-18 10:24:27 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-18 17:25:07 +0000
commitf3a2c72604c18a4c8d981b164aff6b48bb02bf8e (patch)
tree965fc2d4261dcb90be95b1e1ab834cd02e885fc6 /mojo/tools
parent545ea10f82d534003d677dabc61a410fa4af59e1 (diff)
downloadchromium_src-f3a2c72604c18a4c8d981b164aff6b48bb02bf8e.zip
chromium_src-f3a2c72604c18a4c8d981b164aff6b48bb02bf8e.tar.gz
chromium_src-f3a2c72604c18a4c8d981b164aff6b48bb02bf8e.tar.bz2
List fixture-granular failures in mojo apptest output.
List the failing fixtures in the output summary. (rather than listing just the failing apptests) (eg. ViewManagerTest.RootView, not mojo:view_manager_apptests) Regardless of this, any failures are output in full. (this just makes the output easier to read...) #TODO: Ditto for non gtest_isolated apptests. BUG=493535 TEST=Better apptest output summaries. R=sky@chromium.org Review URL: https://codereview.chromium.org/1187763003 Cr-Commit-Position: refs/heads/master@{#335069}
Diffstat (limited to 'mojo/tools')
-rwxr-xr-xmojo/tools/apptest_runner.py19
-rw-r--r--mojo/tools/mopy/gtest.py23
2 files changed, 24 insertions, 18 deletions
diff --git a/mojo/tools/apptest_runner.py b/mojo/tools/apptest_runner.py
index 269ff70..9263a9e 100755
--- a/mojo/tools/apptest_runner.py
+++ b/mojo/tools/apptest_runner.py
@@ -50,7 +50,6 @@ def main():
return result
tests = []
- passed = []
failed = []
for _ in range(args.repeat_count):
for test_dict in test_list:
@@ -62,22 +61,24 @@ def main():
print "Running %s...%s" % (test_name, ("\n" if args.verbose else "")),
sys.stdout.flush()
- tests.append(test_name)
assert test_type in ("gtest", "gtest_isolated")
isolate = test_type == "gtest_isolated"
- result = gtest.run_apptest(config, shell, test_args, test, isolate)
- passed.extend([test_name] if result else [])
- failed.extend([] if result else [test_name])
+ (test, fail) = gtest.run_apptest(config, shell, test_args, test, isolate)
+ tests.extend(test)
+ failed.extend(fail)
+ result = test and not fail
print "[ PASSED ]" if result else "[ FAILED ]",
print test_name if args.verbose or not result else ""
if failed:
break;
- print "[ PASSED ] %d apptests" % len(passed),
- print ": %s" % ", ".join(passed) if passed else ""
- print "[ FAILED ] %d apptests" % len(failed),
- print ": %s" % ", ".join(failed) if failed else ""
+ print "[==========] %d tests ran." % len(tests)
+ print "[ PASSED ] %d tests." % (len(tests) - len(failed))
+ if failed:
+ print "[ FAILED ] %d tests, listed below:" % len(failed)
+ for failure in failed:
+ print "[ FAILED ] %s" % failure
if args.write_full_results_to:
_WriteJSONResults(tests, failed, args.write_full_results_to)
diff --git a/mojo/tools/mopy/gtest.py b/mojo/tools/mopy/gtest.py
index dd47c6f..59cd6ba 100644
--- a/mojo/tools/mopy/gtest.py
+++ b/mojo/tools/mopy/gtest.py
@@ -24,6 +24,8 @@ def set_color():
def run_apptest(config, shell, args, apptest, isolate):
"""Run the apptest; optionally isolating fixtures across shell invocations.
+ Returns the list of tests run and the list of failures.
+
Args:
config: The mopy.config.Config for the build.
shell: The mopy.android.AndroidShell, if Android is the target platform.
@@ -31,16 +33,19 @@ def run_apptest(config, shell, args, apptest, isolate):
apptest: The application test URL.
isolate: True if the test fixtures should be run in isolation.
"""
+ tests = [apptest]
+ failed = []
if not isolate:
- return _run_apptest(config, shell, args, apptest)
-
- fixtures = _get_fixtures(config, shell, args, apptest)
- result = True if fixtures else False
- for fixture in fixtures:
- arguments = args + ["--gtest_filter=%s" % fixture]
- if not _run_apptest(config, shell, arguments, apptest):
- result = False
- return result
+ # TODO(msw): Parse fixture-granular successes and failures in this case.
+ if not _run_apptest(config, shell, args, apptest):
+ failed.append(apptest)
+ else:
+ tests = _get_fixtures(config, shell, args, apptest)
+ for fixture in tests:
+ arguments = args + ["--gtest_filter=%s" % fixture]
+ if not _run_apptest(config, shell, arguments, apptest):
+ failed.append(fixture)
+ return (tests, failed)
def _run_apptest(config, shell, args, apptest):