summaryrefslogtreecommitdiffstats
path: root/tests/auto/bic/tst_bic.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-25 10:32:56 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-25 10:32:56 +0200
commitf035995584ec384c03465fb3a7f73818eb8da652 (patch)
treeb4eb903f7d391f9a1e4a5e5764b5a39a755c1a2a /tests/auto/bic/tst_bic.cpp
parent25c5de7f168652ff5c3e6e49d09567d3ef4b41fd (diff)
Update the test to work with GCC 4.4 too
Diffstat (limited to 'tests/auto/bic/tst_bic.cpp')
-rw-r--r--tests/auto/bic/tst_bic.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp
index 36c35ff08b..b5b503dedb 100644
--- a/tests/auto/bic/tst_bic.cpp
+++ b/tests/auto/bic/tst_bic.cpp
@@ -261,22 +261,18 @@ QBic::Info tst_Bic::getCurrentInfo(const QString &libName)
return QBic::Info();
}
- QString resultFileName = QFileInfo(tmpQFile).fileName();
- static const char *suffixes[] = { ".t01.class", ".class", ".002t.class", 0 };
- for (const char **p = suffixes; true; ++p) {
- if (!p) {
- // we didn't find the file
- qFatal("GCC didn't produce the expected intermediary files. Please update this test!");
- return QBic::Info();
- }
-
- QString check = resultFileName + *p;
- if (!QFile::exists(check))
- continue;
-
- resultFileName = check;
- break;
+ // See if we find the gcc output file, which seems to change
+ // from release to release
+ QStringList files = QDir().entryList(QStringList() << "*.class");
+ if (files.isEmpty()) {
+ qFatal("Could not locate the GCC output file, update this test");
+ return QBic::Info();
+ } else if (files.size() > 1) {
+ qFatal("Located more than one output file, please clean up before running this test");
+ return QBic::Info();
}
+
+ QString resultFileName = files.first();
QBic::Info inf = bic.parseFile(resultFileName);
QFile::remove(resultFileName);