-
Notifications
You must be signed in to change notification settings - Fork 33
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
test: add unit tests infrastructure #115
Conversation
This pull request contains also some fixes/clean-ups I made while working on the tests. |
I like this proposal. The lack of messages might become a issue later when the nr. of tests will grow larger, but for now it I don't see a big problem. |
a4d8cfc
to
6875ceb
Compare
Unit tests now use "Boost.Test" library and there is an explicit distinction between integration tests (the old tests) and unit tests. The two test categories live now in two different directories. To keep the old behaviour, integration tests are on by default, whereas unit tests needs to be explicitly enabled (cmake variable ENABLE_UNIT_TESTS). When unit tests are enabled, Boost.Test library becomes a required dependency. A serial test suite can be defined using this structure:
A parallel test suite can be defined using this structure (only the name of the included file changes with respect to a serial test):
I've not yet tested how Boost.Test handles MPI tests, so I'm not sure if parallel unit tests works properly (VolCartesian module doesn't have parallel tests). |
036e3ba
to
87cc128
Compare
87cc128
to
adb826b
Compare
Next week I'm going to merge this pull request. |
Unit tests will be implemented using the Boost.Test library.
c9ace97
to
f6bb99c
Compare
f6bb99c
to
6f2407e
Compare
This is a first implementation of the unit tests for the VolCartesian patch.
Tests are distributed among 5 suites:
(In some cases, the distinction between these 5 categories is a bit fuzzy, but I think the same applies for any other classification we may come up with. I chose these categories, because I liked the idea to have the tests grouped by some macroscopic features).
Inside each suite, test are grouped in two subtests:
Although we may decide to remove the light memory mode feature (at the present time there may be no applications that use that future), I added unit tests also for that mode just for the sake of completeness.
Unit tests cover all public functions defined in VolCartesian header. Functions defined in the base class Patchkernel and not overloaded inside VolCartesian are not yet included in the tests.
I'm not using any special framework for the tests. If we agree on the usage of boosts_test I will port the tests to this framework (or to any other framework we may decide to use, e.g., Google Test, CppUnit, ...).
Test lacks some output messages explaining which test is currently running, I will add these messages once we define which framework use for handling unit tests.