Unittest and refactoring for RPi baremetal

I wanted to change the previous array based timer to a list based one, and wanted to write a unittest for the list before implementing.
So, added googletest git repo from Chromium repo as a submodule and created Test.mak for unittest on the build machine for the build machine architecture (OSX, x64, mach-o), then refactored the previous 007-wfi with it for the target architecture (RPi2, cortex-a7, elf).

https://github.com/sokoide/rpi-baremetal -> 007_wfi

make -f Test.mak test
[==========] Running 9 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 5 tests from Fifo8Case
[ RUN      ] Fifo8Case.Init
[       OK ] Fifo8Case.Init (0 ms)
[ RUN      ] Fifo8Case.Put
[       OK ] Fifo8Case.Put (0 ms)
[ RUN      ] Fifo8Case.PutGet
[       OK ] Fifo8Case.PutGet (0 ms)
[ RUN      ] Fifo8Case.Put4Get2
[       OK ] Fifo8Case.Put4Get2 (0 ms)
[ RUN      ] Fifo8Case.PutOverflow
[       OK ] Fifo8Case.PutOverflow (0 ms)
[----------] 5 tests from Fifo8Case (0 ms total)

[----------] 4 tests from TimerCase
[ RUN      ] TimerCase.InitTimerCtl
[       OK ] TimerCase.InitTimerCtl (0 ms)
[ RUN      ] TimerCase.InsertTimer1
[       OK ] TimerCase.InsertTimer1 (0 ms)
[ RUN      ] TimerCase.InsertTimer5
[       OK ] TimerCase.InsertTimer5 (0 ms)
[ RUN      ] TimerCase.RemoveTimer
[       OK ] TimerCase.RemoveTimer (0 ms)
[----------] 4 tests from TimerCase (0 ms total)

[----------] Global test environment tear-down
[==========] 9 tests from 2 test cases ran. (0 ms total)
[  PASSED  ] 9 tests.

Leave a Reply

Your email address will not be published. Required fields are marked *