Fix Travis build to skip building test code if the tests are deactivated.