Files
oak-editor/tests/gtest/main.cpp
T
Mike-Solar f03b6b58ff style: reformat C/C++ sources and headers with clang-format
Run clang-format over all project C/C++ source and header files
(.c, .cpp, .cc, .h, .hpp, .hh, .m, .mm) under app/ and tests/.
Non-source files (svg, qm, qrc, etc.) were not touched.
2026-07-13 15:34:11 +08:00

25 lines
766 B
C++

#include <QApplication>
#include <QDir>
#include <QFile>
#include <gtest/gtest.h>
// Configures process-wide Qt/OCIO state before running gtest. Tests default to
// the offscreen QPA plugin so headless or invalid DISPLAY sessions do not abort
// before gtest can report skips/failures.
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(ocioconf);
if (qEnvironmentVariableIsEmpty("OCIO")) {
qputenv("OCIO",
QFile::encodeName(QDir(QStringLiteral(OAK_TEST_SOURCE_DIR))
.filePath(QStringLiteral(
"app/render/ocioconf/config.ocio"))));
}
if (qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM")) {
qputenv("QT_QPA_PLATFORM", "offscreen");
}
QApplication app(argc, argv);
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}