Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/test_main.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); | Q_IMPORT_PLUGIN(QXcbIntegrationPlugin); | ||||
#elif defined(QT_QPA_PLATFORM_WINDOWS) | #elif defined(QT_QPA_PLATFORM_WINDOWS) | ||||
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); | Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); | ||||
#elif defined(QT_QPA_PLATFORM_COCOA) | #elif defined(QT_QPA_PLATFORM_COCOA) | ||||
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); | Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin); | ||||
#endif | #endif | ||||
#endif | #endif | ||||
extern void noui_connect(); | |||||
// This is all you need to run all the tests | // This is all you need to run all the tests | ||||
int main(int argc, char *argv[]) { | int main(int argc, char *argv[]) { | ||||
BasicTestingSetup test{CBaseChainParams::REGTEST}; | // Initialize persistent globals with the testing setup state for sanity. | ||||
// E.g. -datadir in gArgs is set to a temp directory dummy value (instead | |||||
// of defaulting to the default datadir), or globalChainParams is set to | |||||
// regtest params. | |||||
// | |||||
// All tests must use their own testing setup (if needed). | |||||
{ BasicTestingSetup dummy{CBaseChainParams::REGTEST}; } | |||||
auto node = interfaces::MakeNode(); | auto node = interfaces::MakeNode(); | ||||
bool fInvalid = false; | bool fInvalid = false; | ||||
// Prefer the "minimal" platform for the test instead of the normal default | // Prefer the "minimal" platform for the test instead of the normal default | ||||
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally | // platform ("xcb", "windows", or "cocoa") so tests can't unintentionally | ||||
// interfere with any background GUIs and don't require extra resources. | // interfere with any background GUIs and don't require extra resources. | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |