Bug #602
Updated by Anastasia Klimchuk about 22 hours ago
Antonio, thank you so much for reporting this, I really appreciate your effort!
In general, windows is a niche use-case, it's not used/tested often - so the issues can slip in. It is very valuable that you looked into this.
I looked into this issue. The programmer belongs to group_serial and systems_serial and those defined as being supported on windows.
This issue is with the test though. The test defines the flags to mock the `open` command, very specifically test needs to mock this call (line 297 in current source of serial.c https://github.com/flashrom/flashrom/blob/main/serial.c#L297)
However this line is never expected to run on windows. Above currently in the line 269 is the conditional `#if IS_WINDOWS` and the line 297 is on the #else branch.
flashrom code is low level and lots of that is platform-specific, and so are the tests. So for the spidriver programmer the current test is a very good one, but it's written for non-windows. If in theory someone writes a spidriver test for windows, that would be a different test, as it needs to mock different sys/library calls.
The immediate fix I think is to add the condition `if not windows` to the test and have a SKIP_TEST otherwise. Currently test has only condition of `#if CONFIG_SPIDRIVER == 1`
This should hopefully make the tests build on windows, and then you can see how many tests are running? It would be great to have at least some tests running on windows, there are few platform-independent tests like layout logic test or erase/write logic tests, or chip operations tests, these ones should be fine?
Would you be fine to try to add the condition to this test and see if it works? Thank you!