PhoenixPilot/PhoenixPilot — pull request #112 by solidgoldbomb (2012-12-18 06:19:29+00:00)
Title: Use gtest for unit tests

This converts the unit test infrastructure over to use gtest:
* http://code.google.com/p/googletest/

To try this out (on linux):

make gtest_install
make ut_clean
make ut_all
./build/unit_tests/logfs/logfs.elf

The output should look like this (it's in [TAP](http://en.wikipedia.org/wiki/Test_Anything_Protocol) format):

$ ./build/unit_tests/logfs/logfs.elf
Running main() from gtest_main.cc
[==========] Running 15 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 2 tests from LogfsTestRaw
[ RUN ] LogfsTestRaw.FlashInit
[ OK ] LogfsTestRaw.FlashInit (4 ms)
[ RUN ] LogfsTestRaw.LogfsInit
[ OK ] LogfsTestRaw.LogfsInit (3 ms)
[----------] 2 tests from LogfsTestRaw (8 ms total)

[----------] 13 tests from LogfsTestCooked
[ RUN ] LogfsTestCooked.LogfsFormat
[ OK ] LogfsTestCooked.LogfsFormat (6 ms)
[ RUN ] LogfsTestCooked.WriteOne
[ OK ] LogfsTestCooked.WriteOne (2 ms)
[ RUN ] LogfsTestCooked.WriteVerifyOne
[ OK ] LogfsTestCooked.WriteVerifyOne (1 ms)
[ RUN ] LogfsTestCooked.WriteVerifyDeleteVerifyOne
[ OK ] LogfsTestCooked.WriteVerifyDeleteVerifyOne (1 ms)
[ RUN ] LogfsTestCooked.WriteTwoVerifyOneA
[ OK ] LogfsTestCooked.WriteTwoVerifyOneA (2 ms)
[ RUN ] LogfsTestCooked.WriteTwoVerifyOneB
[ OK ] LogfsTestCooked.WriteTwoVerifyOneB (1 ms)
[ RUN ] LogfsTestCooked.WriteZeroSize
[ OK ] LogfsTestCooked.WriteZeroSize (1 ms)
[ RUN ] LogfsTestCooked.WriteVerifyZeroLength
[ OK ] LogfsTestCooked.WriteVerifyZeroLength (2 ms)
[ RUN ] LogfsTestCooked.WriteMaxSize
[ OK ] LogfsTestCooked.WriteMaxSize (2 ms)
[ RUN ] LogfsTestCooked.ReadNonexistent
[ OK ] LogfsTestCooked.ReadNonexistent (2 ms)
[ RUN ] LogfsTestCooked.WriteVerifyMultiInstance
[ OK ] LogfsTestCooked.WriteVerifyMultiInstance (2 ms)
[ RUN ] LogfsTestCooked.FillFilesystemAndGarbageCollect
[ OK ] LogfsTestCooked.FillFilesystemAndGarbageCollect (15 ms)
[ RUN ] LogfsTestCooked.WriteManyVerify
[ OK ] LogfsTestCooked.WriteManyVerify (1810 ms)
[----------] 13 tests from LogfsTestCooked (1847 ms total)

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