aboutsummaryrefslogtreecommitdiff
path: root/src/qt/test/test_main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/test/test_main.cpp')
-rw-r--r--src/qt/test/test_main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp
index 796cf24b36..c39266a397 100644
--- a/src/qt/test/test_main.cpp
+++ b/src/qt/test/test_main.cpp
@@ -61,9 +61,9 @@ int main(int argc, char *argv[])
// platform ("xcb", "windows", or "cocoa") so tests can't unintentionally
// interfere with any background GUIs and don't require extra resources.
#if defined(WIN32)
- _putenv_s("QT_QPA_PLATFORM", "minimal");
+ if (getenv("QT_QPA_PLATFORM") == nullptr) _putenv_s("QT_QPA_PLATFORM", "minimal");
#else
- setenv("QT_QPA_PLATFORM", "minimal", 0);
+ setenv("QT_QPA_PLATFORM", "minimal", /* overwrite */ 0);
#endif
// Don't remove this, it's needed to access