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

Unified Diff: mojo/tools/mopy/gtest.py

Issue 1279833003: Makes mopy turn off gtest coloring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to where we copy env and remove set_color Created 5 years, 4 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 | « mojo/tools/apptest_runner.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mopy/gtest.py
diff --git a/mojo/tools/mopy/gtest.py b/mojo/tools/mopy/gtest.py
index 947fcaa0dfe32942e121b636151a329444c45f1e..fd1199bf002988fb2f61a80e9c9db2bff5ea7f56 100644
--- a/mojo/tools/mopy/gtest.py
+++ b/mojo/tools/mopy/gtest.py
@@ -23,13 +23,6 @@ import xvfb
XVFB_DISPLAY_ID = 9
-def set_color():
- '''Run gtests with color on TTY, unless its environment variable is set.'''
- if sys.stdout.isatty() and 'GTEST_COLOR' not in os.environ:
- logging.getLogger().debug('Setting GTEST_COLOR=yes')
- os.environ['GTEST_COLOR'] = 'yes'
-
-
def run_apptest(config, shell, args, apptest, isolate):
'''Run the apptest; optionally isolating fixtures across shell invocations.
@@ -154,6 +147,9 @@ def _build_command_line(config, args, apptest):
def _run_test_with_xvfb(config, shell, args, apptest):
'''Run the test with xvfb; return the output or raise an exception.'''
env = os.environ.copy()
+ # Make sure gtest doesn't try to add color to the output. Color is done via
+ # escape sequences which confuses the code that searches the gtest output.
+ env['GTEST_COLOR'] = 'no'
if (config.target_os != Config.OS_LINUX or '--gtest_list_tests' in args
or not xvfb.should_start_xvfb(env)):
return _run_test_with_timeout(config, shell, args, apptest, env)
« no previous file with comments | « mojo/tools/apptest_runner.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698