You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
digital_io: test: use thread local storage instead of global line list
Cargo test runs test in parallel using one thread per test.
Usually parallelism in rust is safe enough to not make this an issue
but here we built something intentionally hacky (to keep the non-test/
mock code simple) in the form of a global index of mock GPIO lines whos
values can be read out in test code.
The next commit will introduce a second dut_power thread that uses the
same GPIO lines as the first test.
As all tests run in the same process this means that they share the
same list of mock GPIO lines, resulting in havoc when the tests run in
parallel.
This time we can get around this issue by using a list of mock GPIO
lines per thread so we do not have to complicate the non-test code.
Signed-off-by: Leonard Göhrs <[email protected]>
0 commit comments