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

Side by Side Diff: tools/testrunner/local/commands.py

Issue 2813863002: Reland of [date] Add ICU backend for timezone info behind a flag (Closed)
Patch Set: Skip tests on noi18n Created 3 years, 8 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
« no previous file with comments | « test/mjsunit/testcfg.py ('k') | tools/testrunner/local/execution.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 the V8 project authors. All rights reserved. 1 # Copyright 2012 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 prev_error_mode = SEM_INVALID_VALUE 43 prev_error_mode = SEM_INVALID_VALUE
44 try: 44 try:
45 import ctypes 45 import ctypes
46 prev_error_mode = \ 46 prev_error_mode = \
47 ctypes.windll.kernel32.SetErrorMode(mode) #@UndefinedVariable 47 ctypes.windll.kernel32.SetErrorMode(mode) #@UndefinedVariable
48 except ImportError: 48 except ImportError:
49 pass 49 pass
50 return prev_error_mode 50 return prev_error_mode
51 51
52 52
53 def RunProcess(verbose, timeout, args, **rest): 53 def RunProcess(verbose, timeout, args, additional_env, **rest):
54 if verbose: print "#", " ".join(args) 54 if verbose: print "#", " ".join(args)
55 popen_args = args 55 popen_args = args
56 prev_error_mode = SEM_INVALID_VALUE 56 prev_error_mode = SEM_INVALID_VALUE
57 if utils.IsWindows(): 57 if utils.IsWindows():
58 popen_args = subprocess.list2cmdline(args) 58 popen_args = subprocess.list2cmdline(args)
59 # Try to change the error mode to avoid dialogs on fatal errors. Don't 59 # Try to change the error mode to avoid dialogs on fatal errors. Don't
60 # touch any existing error mode flags by merging the existing error mode. 60 # touch any existing error mode flags by merging the existing error mode.
61 # See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx. 61 # See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx.
62 error_mode = SEM_NOGPFAULTERRORBOX 62 error_mode = SEM_NOGPFAULTERRORBOX
63 prev_error_mode = Win32SetErrorMode(error_mode) 63 prev_error_mode = Win32SetErrorMode(error_mode)
64 Win32SetErrorMode(error_mode | prev_error_mode) 64 Win32SetErrorMode(error_mode | prev_error_mode)
65 65
66 env = os.environ.copy() 66 env = os.environ.copy()
67 env.update(additional_env)
67 # GTest shard information is read by the V8 tests runner. Make sure it 68 # GTest shard information is read by the V8 tests runner. Make sure it
68 # doesn't leak into the execution of gtests we're wrapping. Those might 69 # doesn't leak into the execution of gtests we're wrapping. Those might
69 # otherwise apply a second level of sharding and as a result skip tests. 70 # otherwise apply a second level of sharding and as a result skip tests.
70 env.pop('GTEST_TOTAL_SHARDS', None) 71 env.pop('GTEST_TOTAL_SHARDS', None)
71 env.pop('GTEST_SHARD_INDEX', None) 72 env.pop('GTEST_SHARD_INDEX', None)
72 73
73 try: 74 try:
74 process = subprocess.Popen( 75 process = subprocess.Popen(
75 args=popen_args, 76 args=popen_args,
76 stdout=subprocess.PIPE, 77 stdout=subprocess.PIPE,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 120
120 return output.Output( 121 return output.Output(
121 process.returncode, 122 process.returncode,
122 timeout_result[0], 123 timeout_result[0],
123 stdout.decode('utf-8', 'replace').encode('utf-8'), 124 stdout.decode('utf-8', 'replace').encode('utf-8'),
124 stderr.decode('utf-8', 'replace').encode('utf-8'), 125 stderr.decode('utf-8', 'replace').encode('utf-8'),
125 process.pid, 126 process.pid,
126 ) 127 )
127 128
128 129
129 def Execute(args, verbose=False, timeout=None): 130 def Execute(args, verbose=False, timeout=None, env=None):
130 args = [ c for c in args if c != "" ] 131 args = [ c for c in args if c != "" ]
131 return RunProcess(verbose, timeout, args=args) 132 return RunProcess(verbose, timeout, args, env or {})
OLDNEW
« no previous file with comments | « test/mjsunit/testcfg.py ('k') | tools/testrunner/local/execution.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698