Prospective fix to make lupdate tests pass.
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Mon, 27 Jul 2015 10:20:44 +0000 (12:20 +0200)
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Mon, 27 Jul 2015 17:10:17 +0000 (17:10 +0000)
Suppress the qmake message about creating a .stash file. This should
fix failures like:

FAIL!  : tst_lupdate::good(heuristics) Output for /Users/qt/work/qt/qttools/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt does not meet expectations:
 <<<<<<< got
 Info: creating stash file /Users/qt/work/qt/qttools/tests/auto/linguist/lupdate/testdata/good/heuristics/.qmake.stash
 =========
 >>>>>>> expected

Change-Id: I1f7737e7f8463fcd92a4faf7f87a484de72d0921
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
tests/auto/linguist/lupdate/tst_lupdate.cpp

index 4138c64..0435576 100644 (file)
@@ -60,7 +60,7 @@ private:
     QString m_cmdLupdate;
     QString m_basePath;
 
-    void doCompare(const QStringList &actual, const QString &expectedFn, bool err);
+    void doCompare(QStringList actual, const QString &expectedFn, bool err);
     void doCompare(const QString &actualFn, const QString &expectedFn, bool err);
 };
 
@@ -114,12 +114,17 @@ static bool prepareMatch(const QString &expect, QString *tmpl, int *require, int
     return true;
 }
 
-void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn, bool err)
+void tst_lupdate::doCompare(QStringList actual, const QString &expectedFn, bool err)
 {
     QFile file(expectedFn);
     QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(expectedFn));
     QStringList expected = QString(file.readAll()).split('\n');
 
+    for (int i = actual.size() - 1; i >= 0; --i) {
+        if (actual.at(i).startsWith(QLatin1String("Info: creating stash file ")))
+            actual.removeAt(i);
+    }
+
     int ei = 0, ai = 0, em = expected.size(), am = actual.size();
     int oei = 0, oai = 0, oem = em, oam = am;
     int require = 0, accept = 0;