Files
DevilutionX/test/main.cpp
Gleb Mazovetskiy d94bc424df sgOptions -> GetOptions()
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for #7638, which will statically initialize change
handlers after the Options object has been initialized.
2025-01-13 11:57:25 +00:00

25 lines
576 B
C++

#include <gtest/gtest.h>
#include "headless_mode.hpp"
#include "options.h"
#include "utils/paths.h"
int main(int argc, char **argv)
{
// Disable error dialogs.
devilution::HeadlessMode = true;
#if SDL_VERSION_ATLEAST(2, 0, 0)
// Disable hardware cursor while testing.
devilution::GetOptions().Graphics.hardwareCursor.SetValue(false);
#endif
#ifdef __APPLE__
devilution::paths::SetAssetsPath(
devilution::paths::BasePath() + "devilutionx.app/Contents/Resources/");
#endif
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}