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

Side by Side Diff: tests/run_test_cases/output.py

Issue 19917006: Move all googletest related scripts into googletest/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Remove unnecessary pylint warning disable Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/run_isolated_smoke_test.py ('k') | tests/run_test_cases_smoke_test.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 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """Outputs on both stderr and stdout."""
7
8 import re
9 import sys
10 import time
11
12
13 def main():
14 for command in sys.argv[1:]:
15 if re.match(r'^[0-9\.]+$', command):
16 time.sleep(float(command))
17 continue
18
19 if command.startswith('out_'):
20 pipe = sys.stdout
21 elif command.startswith('err_'):
22 pipe = sys.stderr
23 else:
24 return 1
25
26 command = command[4:]
27 if command == 'print':
28 pipe.write('printing')
29 elif command == 'sleeping':
30 pipe.write('Sleeping.\n')
31 elif command == 'slept':
32 pipe.write('Slept.\n')
33 elif command == 'lf':
34 pipe.write('\n')
35 elif command == 'flush':
36 pipe.flush()
37 else:
38 return 1
39 return 0
40
41
42 if __name__ == '__main__':
43 sys.exit(main())
OLDNEW
« no previous file with comments | « tests/run_isolated_smoke_test.py ('k') | tests/run_test_cases_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698