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

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

Issue 69143004: Delete swarm_client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 7 years, 1 month 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2013 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

Powered by Google App Engine
This is Rietveld 408576698