Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/TetraIF/unittest_main.cpp
T
2026-09-12 13:54:34 +02:00

28 lines
868 B
C++

/**
* @file unittest_main.cpp
* @brief Shared entry point for the TetraIF unit test executables.
*
* GTest::gtest_main provides a main() that neither creates a QCoreApplication
* nor bootstraps the NGL root logger. The classes under test do both: they take
* a logger reference in their constructor, and NGL::NGLLoggerBootstrap throws
* NotCreatedError when the root logger has not been created yet.
*
* This mirrors tests/gtest_qt_main.cpp, minus the QApplication - none of the
* TetraIF unit tests touch widgets.
*/
#include <gtest/gtest.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QCoreApplication>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
NGL::NGLLoggerBootstrap::createNGLRootLogger(QString(), true, QString(), /*quiet=*/true);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}