Skip to content

Migrate all tests to gtest #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 28, 2013
Merged

Conversation

deanberris
Copy link
Member

This PR moves all tests to use Google Test instead of Boost.Test.

When doing your review please limit it to the conversion. I'm aware the the code is not yet in the style formatted by clang-format, but that will be done in a separate PR.

This has been tested on tip-of-trunk clang and libc++ on Mac OS X Mountain Lion. Tests on different platforms would be most appreciated.

deanberris and others added 5 commits January 21, 2013 23:41
This is the simplification of the HTTP client test suite which serves as
a guide for getting other tests migrated to use gtest. Moving forward
the idea is to accomplish the same for all of the tests in cpp-netlib:

* Consolidate logically grouped tests into a single binary.
* Remove all traces of dependency to the Boost.Test framework.
* Get all tests to a "green" state again.

This paves the way for implementing mocks for some internal classes that
we want to be able to change. In the meantime simplifying the test suite
buys us more in the long run as we add more and more tests to the
library.
@glynos
Copy link
Member

glynos commented Jan 27, 2013

The first comment I can make is that all test runs are exactly as they were before the migration on MSVC 2012 (even the test failures were the same).

@deanberris
Copy link
Member Author

Thanks Glyn -- I'll take that as a good thing. I can work on getting things to a "green" state again once this has been merged. I'll give it a few hours before merging and moving on.

@glynos
Copy link
Member

glynos commented Jan 28, 2013

Secondly, not specifically to the work you've done at this time, but the quality of the tests themselves can be improved.

For one, a better strategy (or rule-of-thumb) would be to have only one assertion per test. I could pick almost any test at random and show that it's testing too many things at the same time. This has a number of advantages, not least of which are that the tests are easy to understand, and that regressions are easier to locate (and fix).

In order to better review the tests I would suggest that when you do a PR in the future, try to limit the scope of the PR so that reviewers can better evaluate the changes to the code and the tests.

@deanberris
Copy link
Member Author

Thanks Glyn, you are preaching to the converted re: too big tests. :)

As for the PR, the changes have been reviewed in my fork and this is an integration into the main project. I understand that smaller PRs are easier to review but in this case it's largely a mechanical change so this is an exception.

I'm merging this now.

deanberris added a commit that referenced this pull request Jan 28, 2013
@deanberris deanberris merged commit 623cd33 into cpp-netlib:master Jan 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants