I need to write some unit tests for my branch soon, so I started poking around at the unit testing setup. I wrote a build alias for SCons, so now you can just do
which will use the already built objects (minus main.cpp, plus unittest.cpp which just contains a main() to run the tests) to create an executable
build/vdrift-test. Wiki page here:
http://wiki.vdrift.net/Testing
Then I ran the tests and what do you know, one of them failed:
Code:
[-------------- RUNNING UNIT TESTS --------------]
src/matrix4.cpp(26): 'matrix4_test' FAILED: value1 (1) should be close to value2 (0)
src/matrix4.cpp(27): 'matrix4_test' FAILED: value1 (10) should be close to value2 (20)
src/matrix4.cpp(28): 'matrix4_test' FAILED: value1 (-1.19209e-07) should be close to value2 (-1)
src/matrix4.cpp(33): 'matrix4_test' FAILED: value1 (1) should be close to value2 (0)
src/matrix4.cpp(34): 'matrix4_test' FAILED: value1 (10) should be close to value2 (0)
src/matrix4.cpp(35): 'matrix4_test' FAILED: value1 (-1.19209e-07) should be close to value2 (1)
Results: 29 succeeded, 1 failed
[-------------- UNIT TESTS FINISHED -------------]