Disable multiple ranks for non-MPI unit tests
commitc8047a4b982ad532d02ac1a4f67bcc4063d23b21
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 22 Aug 2015 14:22:19 +0000 (22 17:22 +0300)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 27 Apr 2016 23:39:07 +0000 (28 01:39 +0200)
tree1ddd26694a2e4358f1578cb715019c689569095a
parent8a8904ad6964f7c5d003ab4510f33b635568375f
Disable multiple ranks for non-MPI unit tests

Make tests not explicitly declared in CMake as supporting MPI only run
on a single MPI rank.  This is already the case for the 'test' and
'check' targets, but manually it is possible to run them with multiple
ranks.  Now all other ranks except the master will exit, and only master
will run the tests.  This avoids potential race conditions in tests not
designed for concurrent execution, e.g., related to file system access.
Some cleanup of the related CMake macros.

Closes #1795

Change-Id: I69e88ba3419cce96eb5b0c7e145643accc65533d
src/gromacs/gmxana/legacytests/CMakeLists.txt
src/programs/mdrun/tests/CMakeLists.txt
src/testutils/TestMacros.cmake
src/testutils/testinit.cpp
src/testutils/testinit.h
src/testutils/unittest_main.cpp