Hi folks,
I've made a start on a unit test suite for c-ares, and I'd be
interested in any feedback.
The changes so far are in a branch at
https://github.com/daviddrysdale/c-ares/commits/test, with some key
points being:
- The tests are in C++11 (mostly so I can use gTest/gMock, using a
local copy of 1.7.0), which needed some extra autoconf macros.
- However, I've deliberately not joined up test/configure.ac to the
main configure.ac, so users of the library need not be blocked by a
missing C++ compiler.
- I've added the ability to inject a user-specified malloc/free, so
that allocation failures can be tested.
- I've also added a Travis config to get automatic builds on at least
Linux/OSX happening: https://travis-ci.org/daviddrysdale/c-ares
- I've also set up an initial coveralls.io page to track code
coverage from the Travis builds:
https://coveralls.io/github/daviddrysdale/c-ares
The test/README.md file also has some description of the different
types of test that are possible (although there might only be a couple
of examples of each so far).
Thoughts? Useful?
Regards,
David
Received on 2015-10-09