Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unit tests #133
This PR adds general unit tests (using Google Test) to xoreos.
It's not 100% coverage, far from it. There's currently 1034 indidual tests in 70 file (with ~ one class per file), covering most of Common, many of the Aurora classes and 3 files for image decoders.
Included in the changeset is also some CMake changes. @berenm, if you could double-check that what I did there makes sense, that would be great. Thanks.
I'm also enabling the unit tests in Travis CI and AppVeyor. The former seems to work, but for some reason, AppVeyor throws errors there. "Exception: Other", whatever that is supposed to mean. I don't suppose you might know what the issues is there, or how I can get more usual debug info, @berenm? Because that is just weird :/.
Going forward, more unit tests would be great. For example:
Likewise, new or changed functions in classes already covered by the tests should now be getting unit tests as well.
Comments, criticism, etc. welcome, of course. :)
The ones that do work are:
All other unit tests fail. The ones that work are all small, contained classes/templates and might not even need any DLL at all...
Neat, thanks for checking! :)
Yeah, got the AppVeyor stuff figured out now (although copying the DLLs is a bit hacky). Took a lot of just trying out things, because I don't know jack about Windows anymore.
Because I have no idea how to get Windows to tell me which DLL is missing, I created an "artifact" in AppVeyor consisting of a test binary, downloaded it and looked into it with objdump on my machine. Turns out iconv.dll is needed for some reason (because of the Boost libraries, maybe?), so I added that to the downloads. And also copied all the DLLs needed to the bin directory.
I also now changed the tests that write into files to use the tmp directory (using Boost to query that directory) and fixed two unrelated issues (one in a unit test, one in common/). Now the unit tests all run and pass in AppVeyor as well. :)