diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2015-06-19 20:29:17 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-06-22 20:46:11 +0100 |
commit | d1b5f8f2526ff5d27623a75db52fe641e2e5b6f7 (patch) | |
tree | 0792bd14ee553c50d3ac5882921da928233bed55 /framework | |
parent | c9f2ee5e75ce5a325dffcd764f989e1bb343340e (diff) |
framework/test/base: Recognize returncode 3 as crash on Windows.
Programs that terminate via MSVCRT's abort(), including failed
assertions, return code 3, not a negative number.
This is particularly pertinent now that the use of the standard assert
macro has increased in Mesa (over gallium's assert macro, which would
trap the debugger with INT3, and return a negative exception number.)
Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/test/base.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/framework/test/base.py b/framework/test/base.py index f29fc949a..b4ee4add3 100644 --- a/framework/test/base.py +++ b/framework/test/base.py @@ -109,6 +109,20 @@ class ProcessTimeout(threading.Thread): return self.status +def _is_crash_returncode(returncode): + """Determine whether the given process return code correspond to a + crash. + """ + if sys.platform == 'win32': + # On Windows: + # - For uncaught exceptions the process terminates with the exception + # code, which is usually negative + # - MSVCRT's abort() terminates process with exit code 3 + return returncode < 0 or returncode == 3 + else: + return returncode < 0 + + class Test(object): """ Abstract base class for Test classes @@ -228,7 +242,7 @@ class Test(object): self.interpret_result() - if self.result['returncode'] < 0: + if _is_crash_returncode(self.result['returncode']): # check if the process was terminated by the timeout if self.timeout > 0 and self.__proc_timeout.join() > 0: self.result['result'] = 'timeout' |