Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Peter Marheine.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/67312 )
Change subject: tests: Add workaround to allow tests mock fileno on FreeBSD ......................................................................
Patch Set 4:
(1 comment)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/67312/comment/c57d0b21_6d5357a3 PS2, Line 161: __isthreaded = 0;
Or we could handle all libc calls like we already do for malloc/free. […]
Okay there are three points here and at the moment I did one (in the latest PS), the other two I would like to clarify.
1) I did what Peter said: removed `__isthreaded = 0` from teardown() block.
2)
also perhaps it maybe a good idea to set it right at the very beginning of the whole test suite not 'half way' in when the control flow arrives at setup_chip()
I was thinking about it, but there is only one place, which is literally at the beginning of the whole test suite: in tests/tests.c#main function. Did you mean that?
3)
we could handle all libc calls like we already do for malloc/free. Since all of them can be implemented as macros
This is an interesting idea! Needs a research (before I can say Yes let's do it). Also I think if we would be handling all libc calls that would be much larger patch. But doing this can give benefits long-term. Can we have this patch now and try your larger idea later, what do you think?