From: Stefan Sperling Subject: Re: tog: basic diff regress To: Mark Jamsek Cc: Game of Trees Date: Sat, 15 Apr 2023 11:12:09 +0200 On Sat, Apr 15, 2023 at 06:59:49PM +1000, Mark Jamsek wrote: > This is a rebased diff on top of main with the basic diff and blame > regress, and your TOG_TEST_SCRIPT suggestion. Great! ok. > + if (strncasecmp(line, "SLEEP ", 6) == 0 && > + isdigit((unsigned char)line[6])) { > + sleep(line[6] - '0'); > + *ch = -1; Instead of sleeping, or skipping interactive display based on using_mock_io, we could have scripting instructions that wait until a certain event occurs. Such as "wait until the blame thread signals that it is done". That would also fix the problem and be generally applicable to similar cases such as when the log thread is involved. But perhaps checking using_mock_io is simpler? I am not sure. Interactive use depends on the main thread sleeping in getch(), so in that case the main thread should never block for long. But tests probably won't need that behaviour?