My google foo is failing me. Is there a good way to capture and check the stdout from a function in ceedling?
I’ve got a function (that I can’t change) with a series of printfs and my goal is to ensure the output matches what’s expected.
Print out example:
printf("%26s: % 07.2f" CLI_NEWLINE, " d", a);
printf("%26s: % 07.2f" CLI_NEWLINE, " q", b);
printf("%26s: % 07.2f" CLI_NEWLINE, " d", c);
printf("%26s: % 07.2f" CLI_NEWLINE CLI_NEWLINE, " q", d);
and I’d want to do someting like TEST_ASSERT_EQUAL(out_line_1,"the_formated_string_i_expect");
My thoughts are 1) raw stream of stdout into ceedling? or 2 stream the output of the function to a file then scan it with ceedling? But I haven’t been able to figure either of these out. I know the ideal solution would probably be to not use printf at all and use logging or something similar but I unfortunately don’t have that option here.