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>bb10
parent
f5ea4baa0d
commit
04def3a878
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue