Ideally the tests wouldn't touch the default data directory. Both the core unit tests and the functional tests do this correctly. However,  `src/qt/test/test_bitcoin-qt` seems to create an empty `~/.bitcoin` directory if it doesn't exist yet.
Instead, it should set up a temporary data directory like the other tests.
QApplication app(argc, argv);
    app.setApplicationName("Bitcoin-Qt-test");
    SSL_library_init();
    URITests test1;
    if (QTest::qExec(&test1) != 0) {
        fInvalid = true;
    }
#ifdef ENABLE_WALLET
    PaymentServerTests test2;
    if (QTest::qExec(&test2) != 0) {
        fInvalid = true;
    }
#endif
    RPCNestedTests test3;
    if (QTest::qExec(&test3) != 0) {
        fInvalid = true;
    }
    CompatTests test4;
    if (QTest::qExec(&test4) != 0) {
        fInvalid = true;
    }
#ifdef ENABLE_WALLET
    WalletTests test5;
    if (QTest::qExec(&test5) != 0) {
        fInvalid = true;
    }
#endif
    return fInvalid;
}