Closed zonca closed 6 years ago
Yes. If you decorate a test with MPITest, then it will be tested with a bunch of communicators. If you don't then it will be run symmetrically on on ranks.
Some examples are in:
https://github.com/rainwoodman/pmesh/tree/master/pmesh/tests
test-domain is fully of MPI tests. test-window is full of non-mpi tests. (You can also mix them in the same file, but that's probably not a good design decision).
The other 'feature' of run-tests.py is that it forces you to make sure the package is fully installable; it installs before testing.
Therefore for finding the tests, you must specify how to install them in setup.py. I find it easiest to install the tests as a subpackage of the main package. e.g. https://github.com/rainwoodman/pmesh/blob/master/setup.py#L49
(don't forget init.py)
There are other "cleaner" ways to install the tests, e.g. with a MANIFEST.in file, but more troublesome.
I shall add some information about this in README.
implemented in #18
@rainwoodman recommended to run tests with
runtests
, which has the neat feature of supporting MPI tests.@rainwoodman:
runtests
allow to run mixed MPI and non-MPI tests?py.test
? I tried to vendorrun-tests.py
in the root folder of the package, rename the tested package and run it but it doesn't find any test,py.test
instead finds them.