Tests: Fix parsing of gcc version on SuSE

Change-Id: Ieb8b5a1ea998abbd2d3baf13829f81f9d4cc43e5
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Christian Stenger
2015-04-15 13:53:29 +02:00
committed by hjk
parent 53502d7c5b
commit 62941c7b87

View File

@@ -1067,8 +1067,15 @@ void tst_Dumpers::dumper()
if (pos != -1)
output = output.left(pos);
qDebug() << "Extracting GCC version from: " << output;
if (output.contains(QByteArray("SUSE Linux"))) {
pos = output.indexOf(')');
output = output.mid(pos + 1).trimmed();
pos = output.indexOf(' ');
output = output.left(pos);
} else {
pos = output.lastIndexOf(' ');
output = output.mid(pos + 1);
}
int pos1 = output.indexOf('.');
int major = output.left(pos1++).toInt();
int pos2 = output.indexOf('.', pos1 + 1);