From 23dbbbdc57953fc2558cf494e621b412a0f863d2 Mon Sep 17 00:00:00 2001 From: Joe Ranweiler Date: Tue, 20 Feb 2018 15:38:41 -0800 Subject: [PATCH] Log all test run result cases in native take-over Warning: this does not work correctly with tests that soft fail, e.g. via a `CHECK` assertion. This is because the soft failures only update the child's `DeepState_TestFailed` global variable, but do not exit. What we will soon do is share memory with the child process, and derive the "test result" from that shared memeory. --- src/lib/DeepState.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/lib/DeepState.c b/src/lib/DeepState.c index 1e92df9..cd52b60 100644 --- a/src/lib/DeepState.c +++ b/src/lib/DeepState.c @@ -411,13 +411,25 @@ void DeepState_RunSavedTakeOverCases(jmp_buf env, if (WIFEXITED(wstatus)) { uint8_t status = WEXITSTATUS(wstatus); - if (status) { + switch (status) { + case DeepState_TestRunPass: + DeepState_LogFormat(DeepState_LogInfo, + "Passed: TakeOver test with data from `%s`", + dp->d_name); + break; + case DeepState_TestRunFail: DeepState_LogFormat(DeepState_LogError, "Failed: TakeOver test with data from `%s`", dp->d_name); - } else { - DeepState_LogFormat(DeepState_LogInfo, - "Passed: TakeOver test with data from `%s`", + break; + case DeepState_TestRunAbandon: + DeepState_LogFormat(DeepState_LogError, + "Abandoned: TakeOver test with data from `%s`", + dp->d_name); + break; + default: + DeepState_LogFormat(DeepState_LogError, + "Unknown exit code from test with data from `%s`", dp->d_name); } } else {