From 86e1b289c8246befc37455e7caa101fc20e0bc97 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 15 Sep 2009 11:13:23 +0200 Subject: Make the test work with shadow builds. Reviewed-by: Jesper --- tests/auto/uic/tst_uic.cpp | 18 +++++++++--------- tests/auto/uic/uic.pro | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/auto/uic/tst_uic.cpp b/tests/auto/uic/tst_uic.cpp index c4759e2..60367b9 100644 --- a/tests/auto/uic/tst_uic.cpp +++ b/tests/auto/uic/tst_uic.cpp @@ -55,16 +55,16 @@ class tst_uic : public QObject public: tst_uic(); - + private Q_SLOTS: void initTestCase(); - + void run(); void run_data() const; void compare(); void compare_data() const; - + void cleanupTestCase(); private: @@ -105,8 +105,8 @@ void tst_uic::initTestCase() qDebug() << msg; process.terminate(); - QCOMPARE(QFileInfo(QLatin1String("baseline")).exists(), true); - QCOMPARE(QFileInfo(QLatin1String("generated_ui")).exists(), true); + QCOMPARE(QFileInfo(QLatin1String(SRCDIR "baseline")).exists(), true); + QCOMPARE(QFileInfo(QLatin1String(SRCDIR "generated_ui")).exists(), true); } void tst_uic::run() @@ -163,23 +163,23 @@ void tst_uic::compare() QFile genFile(generatedFile); if (!orgFile.open(QIODevice::ReadOnly | QIODevice::Text)) { - QString err(QLatin1String("Could not read file: %1...")); + QString err(QLatin1String("Could not read file: %1...")); QFAIL(err.arg(orgFile.fileName()).toUtf8()); } if (!genFile.open(QIODevice::ReadOnly | QIODevice::Text)) { - QString err(QLatin1String("Could not read file: %1...")); + QString err(QLatin1String("Could not read file: %1...")); QFAIL(err.arg(genFile.fileName()).toUtf8()); } originalFile = orgFile.readAll(); originalFile.replace(QRegExp(QLatin1String("Created:.{0,25}[\\d]{4,4}")), ""); originalFile.replace(QRegExp(QLatin1String("by: Qt User Interface Compiler version [.\\d]{5,5}")), ""); - + generatedFile = genFile.readAll(); generatedFile.replace(QRegExp(QLatin1String("Created:.{0,25}[\\d]{4,4}")), ""); generatedFile.replace(QRegExp(QLatin1String("by: Qt User Interface Compiler version [.\\d]{5,5}")), ""); - + QCOMPARE(generatedFile, originalFile); } diff --git a/tests/auto/uic/uic.pro b/tests/auto/uic/uic.pro index 411a993..355cb56 100644 --- a/tests/auto/uic/uic.pro +++ b/tests/auto/uic/uic.pro @@ -5,4 +5,4 @@ SOURCES += tst_uic.cpp TARGET = tst_uic # This test is not run on wince (I think) -DEFINES += SRCDIR=\\\"$$PWD\\\" +DEFINES += SRCDIR=\\\"$$PWD/\\\" -- cgit v0.12