Add hook to save crashing tests

This commit is contained in:
Joe Ranweiler
2018-02-13 14:49:36 -08:00
parent dd9c16865d
commit ab43f75361
2 changed files with 11 additions and 1 deletions

View File

@@ -346,6 +346,9 @@ extern void DeepState_SavePassingTest(void);
/* Save a failing test to the output test directory. */
extern void DeepState_SaveFailingTest(void);
/* Save a crashing test to the output test directory. */
extern void DeepState_SaveCrashingTest(void);
/* Jump buffer for returning to `DeepState_Run`. */
extern jmp_buf DeepState_ReturnToRun;
@@ -469,7 +472,11 @@ static int DeepState_ForkAndRunTest(struct DeepState_TestInfo *test) {
return status ? 1 : 0;
}
/* If here, we exited abnormally, and so the test failed. */
/* If here, we exited abnormally, and so the test failed due to a crash. */
if (HAS_FLAG_output_test_dir) {
DeepState_SaveCrashingTest();
}
return 1;
}

View File

@@ -374,6 +374,9 @@ void DeepState_SaveFailingTest(void) {
printf("Saving to %s\n", FLAGS_output_test_dir);
}
/* Save a crashing test to the output test directory. */
void DeepState_SaveCrashingTest(void) {}
/* Return the first test case to run. */
struct DeepState_TestInfo *DeepState_FirstTest(void) {
return DeepState_LastTestInfo;