Appendix B MySQL Router Unit Tests

Testing MySQL Router requires the appropriate flags during the compilation step. While Google Mock and Google Test are bundled to execute the tests, your system requires GCOV installed to optionally execute the code coverage tests. Change the paths and commands according to your needs.

shell> cd ~/src
shell> tar xfvz mysqlfabric-2.0.3.tar.gz
shell> cd 2.0.3
shell> mkdir buildtests
shell> cd buildtests
shell> cmake .. -DENABLE_GCOV=yes -DENABLE_TESTS=yes
shell> make

Now, execute the unit tests:

shell> make test

Optionally, also execute a code coverage report.

Note

This requires GCOV

shell> sh ../tests/gcoverage.sh -o /path/to/html/report

shell> firefox /path/to/html/report/index.html