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

Unified Diff: chrome/test/mini_installer/test_installer.py

Issue 553053002: Emit actions and states from test_installer.py when not in quiet mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/mini_installer/test_installer.py
diff --git a/chrome/test/mini_installer/test_installer.py b/chrome/test/mini_installer/test_installer.py
index 2ce2dd9d451d64be2e6e9b3a00d6f873ba734d25..26d9aa2d45584c6bfd3e7b66f90ddcae7d5a4f00 100644
--- a/chrome/test/mini_installer/test_installer.py
+++ b/chrome/test/mini_installer/test_installer.py
@@ -40,7 +40,7 @@ class Config:
class InstallerTest(unittest.TestCase):
"""Tests a test case in the config file."""
- def __init__(self, name, test, config, variable_expander):
+ def __init__(self, name, test, config, variable_expander, verbose):
"""Constructor.
Args:
@@ -55,6 +55,7 @@ class InstallerTest(unittest.TestCase):
self._test = test
self._config = config
self._variable_expander = variable_expander
+ self._verbose = verbose
self._verifier_runner = verifier_runner.VerifierRunner()
self._clean_on_teardown = True
@@ -87,7 +88,11 @@ class InstallerTest(unittest.TestCase):
# Starting at index 1, we loop through pairs of (action, state).
for i in range(1, len(self._test), 2):
action = self._test[i]
+ if self._verbose:
+ sys.stderr.write('Beginning action %s\n' % action)
RunCommand(self._config.actions[action], self._variable_expander)
+ if self._verbose:
+ sys.stderr.write('Finished action %s\n' % action)
gab 2014/09/09 15:50:10 Shouldn't this go to stdout instead? (i.e. this is
grt (UTC plus 2) 2014/09/09 15:56:48 I would have thought so, but since the whole unitt
state = self._test[i + 1]
self._VerifyState(state)
@@ -117,6 +122,8 @@ class InstallerTest(unittest.TestCase):
Args:
state: A state name.
"""
+ if self._verbose:
+ sys.stderr.write('Verifying state %s\n' % state)
try:
self._verifier_runner.VerifyAll(self._config.states[state],
self._variable_expander)
@@ -289,7 +296,7 @@ def main():
test['name'])
if not args.test or test_name in args.test:
suite.addTest(InstallerTest(test['name'], test['traversal'], config,
- variable_expander))
+ variable_expander, args.verbose))
result = unittest.TextTestRunner(verbosity=(args.verbose + 1)).run(suite)
if is_component_build:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698