From 30ac62ceec43f7632f504ffc48762f67ecad4222 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 7 Jul 2019 02:33:35 +0300 Subject: [PATCH] mdbx-test: add `coredump` status. Change-Id: I9003a891744eb78d91a3e279e20efcb4c1ad736c --- test/config.h | 3 ++- test/osal-unix.cc | 4 +++- test/osal-windows.cc | 12 ++++++++++-- test/test.cc | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/test/config.h b/test/config.h index d4a903ad..decd9612 100644 --- a/test/config.h +++ b/test/config.h @@ -38,7 +38,8 @@ enum actor_status { as_running, as_successful, as_killed, - as_failed + as_failed, + as_coredump, }; const char *testcase2str(const actor_testcase); diff --git a/test/osal-unix.cc b/test/osal-unix.cc index 4c11c011..95e2ab3e 100644 --- a/test/osal-unix.cc +++ b/test/osal-unix.cc @@ -199,7 +199,9 @@ retry: if (WIFEXITED(status)) childs[pid] = (WEXITSTATUS(status) == EXIT_SUCCESS) ? as_successful : as_failed; - else if (WIFSIGNALED(status) || WCOREDUMP(status)) + else if (WCOREDUMP(status)) + childs[pid] = as_coredump; + else if (WIFSIGNALED(status)) childs[pid] = as_killed; else if (WIFSTOPPED(status)) childs[pid] = as_debuging; diff --git a/test/osal-windows.cc b/test/osal-windows.cc index 5858e895..975d8268 100644 --- a/test/osal-windows.cc +++ b/test/osal-windows.cc @@ -312,14 +312,22 @@ actor_status osal_actor_info(const mdbx_pid_t pid) { case EXIT_SUCCESS: status = as_successful; break; - // case EXCEPTION_BREAKPOINT: + case EXCEPTION_BREAKPOINT: case EXCEPTION_SINGLE_STEP: status = as_debuging; break; case STATUS_CONTROL_C_EXIT: - case EXCEPTION_NONCONTINUABLE_EXCEPTION: status = as_killed; break; + case EXCEPTION_ACCESS_VIOLATION: + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + case EXCEPTION_DATATYPE_MISALIGNMENT: + case EXCEPTION_STACK_OVERFLOW: + case EXCEPTION_INVALID_DISPOSITION: + case EXCEPTION_ILLEGAL_INSTRUCTION: + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + status = as_coredump; + break; default: status = as_failed; break; diff --git a/test/test.cc b/test/test.cc index b4661957..05b68d67 100644 --- a/test/test.cc +++ b/test/test.cc @@ -55,6 +55,8 @@ const char *status2str(actor_status status) { return "killed"; case as_failed: return "failed"; + case as_coredump: + return "coredump"; } }