Using Google Test with c++11, if tests are defined across separate compilation units, is the auto-registration mechanism vulnerable to the static initialisation order fiasco?
If not, why not?
EDITED TO ADD:
Specifically: As I understand it, the standard allows the initialisation of the static members of the test classes in other compilation units to occur after entry to main().
The UnitTest::GetInstance() method guarantees that the UnitTest registry is created on first access. But what stops that first access being the invocation of the main Run() method from main(), before any tests are registered?
Perhaps the key is that they are static class members, not static free variables?
According to this answer to an equivalent question, the answer is:
Yes, Google Test's auto-registration mechanism is vulnerable to the static initialisation order fiasco.
If the tests are defined in other compilation units, whether they are registered before
RUN_ALL_TESTS()is invoked depends on compiler-specific behaviour.