test: move fake libev code to fakeev.c/.h files
SWIM unit tests contain a special library for emulating the event loop: swim_test_ev. It provides API similar to libev, but implemented entirely in user-space, including clock functions. The latter is the most important point, as the original libev does not allow to define your own timing functions - internally it relies on select/kqueue/epoll/poll/select/... with true clock. Because of that it is impossible to perform long tests with the original libev, which could last for minutes or even tens of seconds if their count is big. swim_test_ev uses virtual time, where hours can be played in milliseconds. The fake libev is going to be re-used for Raft unit tests. But for that it is necessary to detach it from all SWIM dependencies. -- The patch renames swim_test_ev.c/.h to fakeev.c/.h because they will contain only fakeev functions soon. The swim methods, implementing swim_ev.h via fakeev, are moved to their own file in a separate commit. Because their file will be swim_test_ev.c. If they would be moved here, git would treat it like everything *except* swim functions was moved to fakeev.h/.c. It would ruin git history, and is split in 2 commits to avoid this. Part of #5303
Showing
- test/unit/CMakeLists.txt 3 additions, 3 deletionstest/unit/CMakeLists.txt
- test/unit/fakeev.c 1 addition, 1 deletiontest/unit/fakeev.c
- test/unit/fakeev.h 1 addition, 4 deletionstest/unit/fakeev.h
- test/unit/swim_test_utils.c 0 additions, 1 deletiontest/unit/swim_test_utils.c
- test/unit/swim_test_utils.h 1 addition, 1 deletiontest/unit/swim_test_utils.h
Loading
Please register or sign in to comment