edoddridge / aronnax

An idealised isopycnal model that can be run either with n+1/2 layers, or with n layers and variable bathymetry.
http://aronnax.readthedocs.io/en/latest/
MIT License
24 stars 6 forks source link

Automatically test memory soundness of the core #37

Closed axch closed 7 years ago

axch commented 7 years ago

The current refactoring test suite does a memory soundness check, running the MIM core under valgrind for one n-layer example and one reduced gravity example. This is both unpleasant, because running under valgrind is slow, and inadequate, because I don't think those examples constitute reasonable coverage for detecting memory access problems in the whole code (at the very least, an ideal such test suite should cover every syntactic array access, to check for reads and writes off the end).

Ergo, I think it appropriate to define a separate build, possibly entrusted to Travis so it gets run without the developers needing to manually run it all the time, which runs a fuller suite of examples under valgrind. It might also be possible to bootstrap that into measuring the rate of memory leaks (which we may or may not be able to hold to zero, possibly depending on the platform on which the build is run).

The examples need not be high-resolution or long-duration to cover this purpose; they just need sufficient branch coverage.

edoddridge commented 7 years ago

I've just submitted a pull request ( #41 ) that runs the current test suite on Travis-CI. It runs in under a minute, so I'm not sure we need to worry too much about its speed just yet.

We should however expand the test suite to cover the other features described in #6.