diff options
author | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2015-10-28 13:52:31 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@theqtcompany.com> | 2016-02-02 16:27:55 +0000 |
commit | 04def3a8786c59a1161df3a10d966311ae9fef2d (patch) | |
tree | aab5cec993bb7a27d020efdd3b214292ff7d7572 /tests/auto/widgets/util | |
parent | f5ea4baa0dc81907f4375fe9620dc9c73c26d94c (diff) |
Don't clutter up the source tree with .qm files generated by testing.
Generate the qundo*.qm files for tst_QUndo*::commandTextFormat() in
the current directory (out of source, for a shadow build) rather than
alongside the qundo*.ts from which they're derived (in the source
tree); and remove them once loaded, if that succeeds. (On failure, we
might even want to look at them.)
Task-number: QTBUG-49081
Change-Id: I666985fa3ceb8c25c917b617d6d39141eddebb76
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests/auto/widgets/util')
-rw-r--r-- | tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp | 8 | ||||
-rw-r--r-- | tests/auto/widgets/util/qundostack/tst_qundostack.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp index 9f03e9b3a0..600c6255d8 100644 --- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp +++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp @@ -624,13 +624,13 @@ void tst_QUndoGroup::commandTextFormat() const QString tsFile = QFINDTESTDATA("testdata/qundogroup.ts"); QVERIFY(!tsFile.isEmpty()); - QVERIFY(!QProcess::execute(binDir + "/lrelease " + tsFile)); + QFile::remove("qundogroup.qm"); // Avoid confusion by strays. + QVERIFY(!QProcess::execute(binDir + "/lrelease " + tsFile + " -qm qundogroup.qm")); QTranslator translator; - const QString qmFile = QFINDTESTDATA("testdata/qundogroup.qm"); - QVERIFY(!qmFile.isEmpty()); - QVERIFY(translator.load(qmFile)); + QVERIFY(translator.load("qundogroup.qm")); + QFile::remove("qundogroup.qm"); qApp->installTranslator(&translator); QUndoGroup group; diff --git a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp index 2c8a9a3ee5..9c861a5702 100644 --- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp +++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp @@ -2968,12 +2968,12 @@ void tst_QUndoStack::commandTextFormat() const QString tsFile = QFINDTESTDATA("testdata/qundostack.ts"); QVERIFY(!tsFile.isEmpty()); - QVERIFY(!QProcess::execute(binDir + "/lrelease " + tsFile)); + QFile::remove("qundostack.qm"); // Avoid confusion by strays. + QVERIFY(!QProcess::execute(binDir + "/lrelease " + tsFile + " -qm qundostack.qm")); QTranslator translator; - const QString qmFile = QFINDTESTDATA("testdata/qundostack.qm"); - QVERIFY(!qmFile.isEmpty()); - QVERIFY(translator.load(qmFile)); + QVERIFY(translator.load("qundostack.qm")); + QFile::remove("qundostack.qm"); qApp->installTranslator(&translator); QUndoStack stack; |