From 04def3a8786c59a1161df3a10d966311ae9fef2d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 28 Oct 2015 13:52:31 +0100 Subject: Don't clutter up the source tree with .qm files generated by testing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp | 8 ++++---- tests/auto/widgets/util/qundostack/tst_qundostack.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') 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; -- cgit v1.2.3