Buffer 'GBA: '-prefixed messages

TODO: Detect illegal opcodes in the test runner because mgba-rom-test
evaluates them very slowly, making the TIMEOUT mechanism effectively
realtime.
This commit is contained in:
Martin Griffin 2023-10-15 18:53:11 +01:00
parent 77e2b0dd2c
commit ef1c60de67

View File

@ -2,9 +2,9 @@
* parses the output to display human-readable progress. * parses the output to display human-readable progress.
* *
* Output lines starting with "GBA Debug: :" are parsed as commands to * Output lines starting with "GBA Debug: :" are parsed as commands to
* Hydra, other output lines starting with "GBA Debug: " are parsed as * Hydra, other output lines starting with "GBA Debug: " or with "GBA: "
* output from the current test, and any other lines are parsed as * are parsed as output from the current test, and any other lines are
* output from the mgba-rom-test process itself. * parsed as output from the mgba-rom-test process itself.
* *
* COMMANDS * COMMANDS
* N: Sets the test name to the remainder of the line. * N: Sets the test name to the remainder of the line.
@ -75,10 +75,17 @@ static void handle_read(int i, struct Runner *runner)
{ {
eol++; eol++;
size_t n = eol - sol; size_t n = eol - sol;
if (runner->input_buffer_size >= strlen("GBA Debug: ") char *soc;
&& !strncmp(sol, "GBA Debug: ", strlen("GBA Debug: "))) if (runner->input_buffer_size >= strlen("GBA: ")
&& !strncmp(sol, "GBA: ", strlen("GBA: ")))
{ {
char *soc = sol + strlen("GBA Debug: "); soc = sol + strlen("GBA: ");
goto buffer_output;
}
else if (runner->input_buffer_size >= strlen("GBA Debug: ")
&& !strncmp(sol, "GBA Debug: ", strlen("GBA Debug: ")))
{
soc = sol + strlen("GBA Debug: ");
if (soc[0] == ':') if (soc[0] == ':')
{ {
switch (soc[1]) switch (soc[1])