| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 | 6 |
| 7 """Simple testing harness for running commands and checking expected output. | 7 """Simple testing harness for running commands and checking expected output. |
| 8 | 8 |
| 9 This harness is used instead of shell scripts to ensure windows compatibility | 9 This harness is used instead of shell scripts to ensure windows compatibility |
| 10 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 # the process safely when untrusted code crashes. We get the exit | 198 # the process safely when untrusted code crashes. We get the exit |
| 199 # code associated with the HLT instruction. | 199 # code associated with the HLT instruction. |
| 200 win64_exit_via_ntdll_patch = [ | 200 win64_exit_via_ntdll_patch = [ |
| 201 MungeWindowsErrorExit(STATUS_PRIVILEGED_INSTRUCTION)] | 201 MungeWindowsErrorExit(STATUS_PRIVILEGED_INSTRUCTION)] |
| 202 | 202 |
| 203 | 203 |
| 204 # 32-bit processes on Mac OS X return SIGBUS in most of the cases where Linux | 204 # 32-bit processes on Mac OS X return SIGBUS in most of the cases where Linux |
| 205 # returns SIGSEGV, except for actual x86 segmentation violations. 64-bit | 205 # returns SIGSEGV, except for actual x86 segmentation violations. 64-bit |
| 206 # processes on Mac OS X behave differently. | 206 # processes on Mac OS X behave differently. |
| 207 status_map = { | 207 status_map = { |
| 208 'sigtrap' : { |
| 209 'linux2': [-5], # SIGTRAP |
| 210 'darwin': [-5], # SIGTRAP |
| 211 }, |
| 208 'trusted_sigabrt' : { | 212 'trusted_sigabrt' : { |
| 209 'linux2': [-6], # SIGABRT | 213 'linux2': [-6], # SIGABRT |
| 210 'mac32': [-6], # SIGABRT | 214 'mac32': [-6], # SIGABRT |
| 211 'mac64': [-6], # SIGABRT | 215 'mac64': [-6], # SIGABRT |
| 212 # On Windows, NaClAbort() exits using the HLT instruction. | 216 # On Windows, NaClAbort() exits using the HLT instruction. |
| 213 'win32': [MungeWindowsErrorExit(STATUS_PRIVILEGED_INSTRUCTION)], | 217 'win32': [MungeWindowsErrorExit(STATUS_PRIVILEGED_INSTRUCTION)], |
| 214 'win64': [MungeWindowsErrorExit(STATUS_PRIVILEGED_INSTRUCTION)], | 218 'win64': [MungeWindowsErrorExit(STATUS_PRIVILEGED_INSTRUCTION)], |
| 215 }, | 219 }, |
| 216 'naclabort_coverage' : { | 220 'naclabort_coverage' : { |
| 217 # This case is here because NaClAbort() behaves differently when | 221 # This case is here because NaClAbort() behaves differently when |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 # Bogus time, since only ProcessLogOutputCombined failed. | 657 # Bogus time, since only ProcessLogOutputCombined failed. |
| 654 Print(FailureMessage(0.0) + ' ProcessLogOutputCombined failed!') | 658 Print(FailureMessage(0.0) + ' ProcessLogOutputCombined failed!') |
| 655 return 1 | 659 return 1 |
| 656 return 0 | 660 return 0 |
| 657 | 661 |
| 658 if __name__ == '__main__': | 662 if __name__ == '__main__': |
| 659 retval = Main(sys.argv[1:]) | 663 retval = Main(sys.argv[1:]) |
| 660 # Add some whitepsace to make the logs easier to read. | 664 # Add some whitepsace to make the logs easier to read. |
| 661 sys.stdout.write('\n\n') | 665 sys.stdout.write('\n\n') |
| 662 sys.exit(retval) | 666 sys.exit(retval) |
| OLD | NEW |