Fix hw detection more
commit7157df826278084554fec9a09d32e97bac6deaf9
authorMark Abraham <mark.j.abraham@gmail.com>
Thu, 26 Oct 2017 08:36:13 +0000 (26 10:36 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 27 Oct 2017 12:20:46 +0000 (27 14:20 +0200)
treed1e91996f9f2912b0a155ed2bff4c27bbc6c3405
parent13ef49aff5d81f8fb68ed8ff1a2ef1a040b388de
Fix hw detection more

gmx_hardware_detect was called in response to GoogleTest environment
SetUp function, so the cleanup for its global should occur in response
to the corresponding TearDown function. Both those should be virtual.
Thus the hardwareInfo should not be in a smart pointer called by a
destructor that might be called at a different point from TearDown.

The new getter function and the callback that handles making the first
call to it conform better to GoogleTest's recommendation to arrange to
call AddGlobalTestEnvironment from main() rather than rely on static
initialization.

Made hardwareInit a non-member function because that improves
encapsulation.

Change-Id: I2f8e14ecc1707bf31d023a4eb4fea0a20543910b
src/gromacs/ewald/tests/CMakeLists.txt
src/gromacs/ewald/tests/pmegathertest.cpp
src/gromacs/ewald/tests/pmesolvetest.cpp
src/gromacs/ewald/tests/pmesplinespreadtest.cpp
src/gromacs/ewald/tests/testhardwarecontexts.cpp
src/gromacs/ewald/tests/testhardwarecontexts.h
src/testutils/TestMacros.cmake
src/testutils/testinit.cpp
src/testutils/testinit.h
src/testutils/unittest_main.cpp