Hi,

Thanks for all response on this issue. As far as I can understand, all of you (Atgeirr, Roland and Joakim) recommend CTest for unit testing, maybe just with a little different wrapping. One difference I can see is that Joakim use 'add_test (...)' in CMakeList.txt, while Roland/Atgeirr add the test in CMakeLists_files.cmake. One advantage of 'add_test(...)' is that you can send arguments (e.g. grids and other model data) to the test executable. When it comes to the Boost Test Library, I think of it as a handy tool to write such tests (but not strictly necessary).

Unit testing is no doubt important to test small components of the code, which when put together make up an application/executable (e.g. opm-upscaling/build/bin/upscale_perm). In addition, I think it would be very nice to test hole executables to see if they produce the intended output, i.e. compare with some reference solution. As far as I understand (please correct me if mistaken) this is not a feature of CTest. I know that you can use 'add_test (...)' to see if the executable runs, but this will not check if the results are correct. I also know that it is possible to use 'set_tests_properties (<test_name> PROPERTIES PASS_REGULAR_EXPRESSION <reg_exp>)' to check if what is printed to console is equal to some reference solution. However, as Atgeirr pointed out, you can not expect the exact same results from two equal runs.

An issue to discuss is therefore if unit tests with CTest are sufficient, or if we also should include a test environment for executables? If yes, then how could this be done? Any thoughts or ideas?

Cheers,
Lars



_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm

Reply via email to