Skip to content
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

make check should run unit tests #128

Closed
rolk opened this issue Jan 23, 2013 · 7 comments
Closed

make check should run unit tests #128

rolk opened this issue Jan 23, 2013 · 7 comments

Comments

@rolk
Copy link
Member

rolk commented Jan 23, 2013

In the cmake branch, they are currently only compiled not run.

@andlaus
Copy link
Contributor

andlaus commented Jan 23, 2013

@rolk I've created a CDash project for opm-core, see

http://opm-project.org/CDash/index.php?project=opm-core

if you don't want to use it, I will remove it again.

@atgeirr
Copy link
Member

atgeirr commented Jan 23, 2013

I'm not familiar with CDash, but I assume that it can be used to automatically build and test the library. However, I could not figure out if that had been set up. It would be a good thing to have, certainly.

We do build tests internally with Jenkins, but any additional testing is good!

@rolk
Copy link
Member Author

rolk commented Jan 23, 2013

I could need some guidance on how the tests are run; about one third of them uses Boost.Test, but many of the remaining don't even return a status value!

@bska
Copy link
Member

bska commented Jan 24, 2013

We currently do not run any tests automatically. At best, the tests that use Boost.Test are invoked manually, e.g.,

$ ./test_wells
Running 3 test cases...

*** No errors detected

All other executables in the tests directories aren't really tests in the language of "unit tests". They are more akin to quick (manual) checks that we get expected behaviour. For instance, the test_sf2p executable simply computes mobilities and mobility derivatives at a number of saturation points to verify (by inspection) that a particular fluid model behaves as expected. I think many of these should simply be removed and the remaining converted into proper tests.

@rolk
Copy link
Member Author

rolk commented Jan 24, 2013

We can of course run the tests and then grep for key items that determines if they are accurate. However, I think Boost.Test unit tests (or some other unit testing framework -- Boost.Test already being used) are the best approach, because the build system could just iterate all files and run them.

I suggest that I move everything that does not currently run automatically into a separate directory (for later cleanup, whenever that will be) and then automate the rest. I think it would make it easier to write more unit tests in the future.

@bska
Copy link
Member

bska commented Jan 24, 2013

@rolk stated:

I suggest that I move everything that does not currently run automatically into a separate directory ... and then automate the rest

Yes, please. That would be great.

@rolk
Copy link
Member Author

rolk commented Jan 24, 2013

This issue should be fixed as of commit ade22d2

To add a new unit test, put a file called test_XXX.cpp in the directory tests/. It will be automatically picked up by the build system. It should use Boost.Test to provide an acceptable interface to the testing framework.

@rolk rolk closed this as completed Jan 24, 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

No branches or pull requests

4 participants