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

Unified Diff: tests/gclient_test.py

Issue 8135007: Improve logging and ease debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: address review comments Created 9 years, 2 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 | « gclient_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_test.py
diff --git a/tests/gclient_test.py b/tests/gclient_test.py
index b56cab8cfd4fbd25527b45bf72e81ef9b4fe086a..d883fc76126270819a6c9a6bd3cfcc7375559ac7 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -19,6 +19,7 @@ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(BASE_DIR))
import gclient
+import gclient_utils
from tests import trial_dir
@@ -162,6 +163,7 @@ class GclientTest(trial_dir.TestCase):
'svn://example.com/foo/dir1/dir2/dir3/dir4/dir1/another',
],
actual)
+
self._check_requirements(
obj.dependencies[0],
{
@@ -192,6 +194,7 @@ class GclientTest(trial_dir.TestCase):
self.assertEquals({}, expected)
def _get_processed(self):
+ """Retrieves the item in the order they were processed."""
items = []
try:
while True:
@@ -239,9 +242,13 @@ class GclientTest(trial_dir.TestCase):
if __name__ == '__main__':
+ sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
+ sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout, include_zero=True)
+ sys.stderr = gclient_utils.MakeFileAutoFlush(sys.stderr)
+ sys.stderr = gclient_utils.MakeFileAnnotated(sys.stderr, include_zero=True)
logging.basicConfig(
level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][
min(sys.argv.count('-v'), 3)],
- format='%(asctime).19s %(levelname)s %(filename)s:'
- '%(lineno)s %(message)s')
+ format='%(relativeCreated)4d %(levelname)5s %(module)13s('
+ '%(lineno)d) %(message)s')
unittest.main()
« no previous file with comments | « gclient_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698