MCPcopy Create free account
hub / github.com/LibrePCB/LibrePCB / main

Function main

tests/unittests/main.cpp:40–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38 ******************************************************************************/
39
40int main(int argc, char* argv[]) {
41 // From librepcb/main.cpp - not sure if we need this also in the unit tests,
42 // but at least it shouldn't hurt.
43 if (qEnvironmentVariableIsEmpty("QT_MAX_CACHED_GLYPH_SIZE")) {
44 qputenv("QT_MAX_CACHED_GLYPH_SIZE", "32");
45 }
46
47 // initialize a common locale for all tests
48 QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
49
50 // many classes rely on a QApplication instance, so we create it here
51 QApplication app(argc, argv);
52 QApplication::setOrganizationName("LibrePCB");
53 QApplication::setOrganizationDomain("librepcb.org");
54 QApplication::setApplicationName("LibrePCB-UnitTests");
55
56 // disable the whole debug output (we want only the output from gtest)
57 Debug::instance()->setDebugLevelLogFile(Debug::DebugLevel_t::Nothing);
58 Debug::instance()->setDebugLevelStderr(Debug::DebugLevel_t::Nothing);
59
60 // Perform global initialization tasks.
61 Application::loadBundledFonts();
62
63 // init gmock and run all tests
64 ::testing::InitGoogleMock(&argc, argv);
65 return RUN_ALL_TESTS();
66}

Callers

nothing calls this directly

Calls 2

setDebugLevelLogFileMethod · 0.80
setDebugLevelStderrMethod · 0.80

Tested by

no test coverage detected