OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 pass | 410 pass |
411 return prev_error_mode | 411 return prev_error_mode |
412 | 412 |
413 def RunProcess(context, timeout, args, **rest): | 413 def RunProcess(context, timeout, args, **rest): |
414 if context.verbose: print "#", " ".join(args) | 414 if context.verbose: print "#", " ".join(args) |
415 popen_args = args | 415 popen_args = args |
416 prev_error_mode = SEM_INVALID_VALUE; | 416 prev_error_mode = SEM_INVALID_VALUE; |
417 if utils.IsWindows(): | 417 if utils.IsWindows(): |
418 popen_args = '"' + subprocess.list2cmdline(args) + '"' | 418 popen_args = '"' + subprocess.list2cmdline(args) + '"' |
419 if context.suppress_dialogs: | 419 if context.suppress_dialogs: |
420 # Try to change the error mode to avoid dialogs on fatal errors. | 420 # Try to change the error mode to avoid dialogs on fatal errors. Don't |
421 Win32SetErrorMode(SEM_NOGPFAULTERRORBOX) | 421 # touch any existing error mode flags by merging the existing error mode. |
| 422 # See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx. |
| 423 error_mode = SEM_NOGPFAULTERRORBOX; |
| 424 prev_error_mode = Win32SetErrorMode(error_mode); |
| 425 Win32SetErrorMode(error_mode | prev_error_mode); |
422 process = subprocess.Popen( | 426 process = subprocess.Popen( |
423 shell = utils.IsWindows(), | 427 shell = utils.IsWindows(), |
424 args = popen_args, | 428 args = popen_args, |
425 **rest | 429 **rest |
426 ) | 430 ) |
427 if utils.IsWindows() and context.suppress_dialogs and prev_error_mode != SEM_I
NVALID_VALUE: | 431 if utils.IsWindows() and context.suppress_dialogs and prev_error_mode != SEM_I
NVALID_VALUE: |
428 Win32SetErrorMode(prev_error_mode) | 432 Win32SetErrorMode(prev_error_mode) |
429 # Compute the end time - if the process crosses this limit we | 433 # Compute the end time - if the process crosses this limit we |
430 # consider it timed out. | 434 # consider it timed out. |
431 if timeout is None: end_time = None | 435 if timeout is None: end_time = None |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 for entry in timed_tests[:20]: | 1305 for entry in timed_tests[:20]: |
1302 t = FormatTime(entry.duration) | 1306 t = FormatTime(entry.duration) |
1303 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1307 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
1304 index += 1 | 1308 index += 1 |
1305 | 1309 |
1306 return result | 1310 return result |
1307 | 1311 |
1308 | 1312 |
1309 if __name__ == '__main__': | 1313 if __name__ == '__main__': |
1310 sys.exit(Main()) | 1314 sys.exit(Main()) |
OLD | NEW |