Ondrej Certik wrote:
I have a question regarding tests - do some of them actually test for a correctness? It seems to me, that most of them only test, if sfepy runs for the given input and mesh, but we should also test, that the result of the calculation is actually correct. For example when I polish the schrodinger solver, the simple test is to check that all the energies are correct.
The test_input_* files test only, that an input file included in the distro works (= some result is obtained, and the process converged). They do not test actual physical/mathematical correctness of the results (yet).
For example this one:
tests/test_quadratures.py
Does it test for a correctness? It seems to me, that this code
def test_problemCreation( self ): from sfe.solvers.generic import solveStationary problem, vec, data = solveStationary( self.conf ) ok = True return ok
Always returns "ok", no matter what was returned in vec and data.
Yes, this test file is not finished. There are probably others that could test more than they test so far. I have usually written tests only when something went actually wrong :)
So for schroedinger: you can use Test( TestInput ) to have test_input() method for free and add, for example, test_energies() and other methods to your Test class to verify correctness - those can use the solution already computed in test_input(), but you have to enforce a correct order of evaluation by using the 'tests' list (attribute of your Test class, see test_meshio.py).
r.
r.