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

Side by Side Diff: mojo/tools/mopy/dart_apptest.py

Issue 1144673003: Fix and cleanup Mojo and Mandoline python scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments. Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « mojo/tools/mopy/config.py ('k') | mojo/tools/mopy/gn.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import logging
6
7 _logging = logging.getLogger()
8
9 from mopy import test_util
10 from mopy.print_process_error import print_process_error
11
12
13 # TODO(erg): Support android, launched services and fixture isolation.
14 def run_test(config, shell, apptest_dict, shell_args, apps_and_args=None):
15 """Runs a command line and checks the output for signs of gtest failure.
16
17 Args:
18 config: The mopy.config.Config object for the build.
19 shell_args: The arguments for mojo_shell.
20 apps_and_args: A Dict keyed by application URL associated to the
21 application's specific arguments.
22 """
23 apps_and_args = apps_and_args or {}
24 output = test_util.try_run_test(config, shell, shell_args, apps_and_args)
25 # Fail on output with dart unittests' "FAIL:"/"ERROR:" or a lack of "PASS:".
26 # The latter condition ensures failure on broken command lines or output.
27 # Check output instead of exit codes because mojo_shell always exits with 0.
28 if (not output or
29 '\nFAIL: ' in output or
30 '\nERROR: ' in output or
31 '\nPASS: ' not in output):
32 print "Failed test:"
33 print_process_error(
34 test_util.build_command_line(config, shell_args, apps_and_args),
35 output)
36 return "Failed test(s) in %r" % apptest_dict
37 _logging.debug("Succeeded with output:\n%s" % output)
38 return "Succeeded"
OLDNEW
« no previous file with comments | « mojo/tools/mopy/config.py ('k') | mojo/tools/mopy/gn.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698