If in take-over mode, exit on fatal error

In take-over mode, the "test" is the entire binary being executed as a
child process. So, we want to exit, rather than trying to `longjmp()` to
`DeepState_ReturnToRun`, which was never initialized.
This commit is contained in:
Joe Ranweiler 2018-02-20 15:29:39 -08:00
parent 065c97c2c0
commit a81f816d89
No known key found for this signature in database
GPG Key ID: E0B6458CB03D167E

View File

@ -65,7 +65,13 @@ void DeepState_Crash(void) {
DEEPSTATE_NORETURN
void DeepState_Fail(void) {
DeepState_TestFailed = 1;
longjmp(DeepState_ReturnToRun, 1);
if (FLAGS_take_over) {
// We want to communicate the failure to a parent process, so exit.
exit(DeepState_TestRunFail);
} else {
longjmp(DeepState_ReturnToRun, 1);
}
}
/* Mark this test as passing. */