Misc testing tweaks

This commit is contained in:
Aaron Culliney 2018-07-29 16:42:33 -07:00
parent 596f767b9a
commit 14bb75a941
2 changed files with 3 additions and 10 deletions

View File

@ -31,17 +31,10 @@ void test_type_input_deterministically(const char *input) {
}
void test_breakpoint(void *arg) {
fprintf(GREATEST_STDOUT, "DISPLAY NOTE: busy-spinning in test_breakpoint(), needs gdb/lldb intervention to continue...\n");
volatile bool debug_continue = false;
while (!debug_continue) {
struct timespec ts = { .tv_sec=0, .tv_nsec=33333333 };
nanosleep(&ts, NULL);
}
fprintf(GREATEST_STDOUT, "OOPS set a breakpoint in test_breakpoint() to diagnose test failure...\n");
}
void test_common_init(void) {
GREATEST_SET_BREAKPOINT_CB(test_breakpoint, NULL);
#if __ANDROID__
// tags help us wade through log soup
#else
@ -66,8 +59,7 @@ void test_common_init(void) {
c_debugger_set_watchpoint(WATCHPOINT_ADDR);
fprintf(stderr, "NOTE : RUNNING WITH DISPLAY\n");
fprintf(stderr, "Will spinloop on failed tests for debugger intervention\n");
fprintf(stderr, "Break in test_breakpoint() to catch and diagnose test failures...\n");
c_debugger_set_timeout(0);
}

View File

@ -7411,6 +7411,7 @@ GREATEST_SUITE(test_suite_cpu) {
GREATEST_SET_SETUP_CB(testcpu_setup, NULL);
GREATEST_SET_TEARDOWN_CB(testcpu_teardown, NULL);
GREATEST_SET_BREAKPOINT_CB(test_breakpoint, NULL);
srandom(time(NULL));