diff --git a/tests/qttest/qetapptest.h b/tests/qttest/qetapptest.h index 6e93f8ea5..123352abb 100644 --- a/tests/qttest/qetapptest.h +++ b/tests/qttest/qetapptest.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -86,6 +87,11 @@ inline QAction *action(const QString &name) template int run(int argc, char **argv) { + //Some files are written to the standard folders whatever + //--data-dir says (qet-assistant.json, with the live-mode token, as + //the editor opens): test mode, before anything is written, keeps + //them away from the user's own + QStandardPaths::setTestModeEnabled(true); QApplication app(argc, argv); QCoreApplication::setOrganizationName("QElectroTech"); QCoreApplication::setApplicationName("QElectroTech"); diff --git a/tests/qttest/tst_assistantinfopaths.cpp b/tests/qttest/tst_assistantinfopaths.cpp index 96e99dd67..21d7a10b5 100644 --- a/tests/qttest/tst_assistantinfopaths.cpp +++ b/tests/qttest/tst_assistantinfopaths.cpp @@ -25,7 +25,6 @@ #include #include #include -#include /** qet-assistant.json names the user and company collections, and the qet @@ -88,13 +87,6 @@ private slots: } }; -int main(int argc, char **argv) -{ - //AssistantInfo writes to the standard data folder, whatever - //--data-dir says, and QETApp writes it as its editor opens: test - //mode from the very start keeps the user's own file out of reach. - QStandardPaths::setTestModeEnabled(true); - return QetAppTest::run(argc, argv); -} +QET_APP_TEST_MAIN(tst_assistantinfopaths) #include "tst_assistantinfopaths.moc"