Does Google Test auto-registration avoid the static initialisation order fiasco?

Viewed 729

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?

2 Answers
Related