From f250b8717cc35f55d1b6e1965419eca5334d77d9 Mon Sep 17 00:00:00 2001 From: Lucian Varlan Date: Tue, 4 Jan 2011 15:49:39 +0200 Subject: Use SRCDIR as a base path for the test data. The test cannot run on harmattan CI system, which executes it from a different directory than the one where the executable resides. Reviewed-by: Adrian Constantin Reviewed-by: Harald Fernengel --- tests/auto/qlayout/qlayout.pro | 2 ++ tests/auto/qlayout/tst_qlayout.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro index 08727e5..d3b76e3 100644 --- a/tests/auto/qlayout/qlayout.pro +++ b/tests/auto/qlayout/qlayout.pro @@ -11,6 +11,8 @@ wince*|symbian: { addFiles.path = . DEPLOYMENT += addFiles } else { + DEFINES += SRCDIR=\\\"$$PWD\\\" + test_data.files = baseline/* test_data.path = $${target.path}/baseline INSTALLS += test_data diff --git a/tests/auto/qlayout/tst_qlayout.cpp b/tests/auto/qlayout/tst_qlayout.cpp index 65eae55..3090ebb 100644 --- a/tests/auto/qlayout/tst_qlayout.cpp +++ b/tests/auto/qlayout/tst_qlayout.cpp @@ -156,7 +156,8 @@ void tst_QLayout::smartMaxSize() { QVector expectedWidths; - QFile f(QLatin1String("baseline/smartmaxsize")); + QFile f(QLatin1String(SRCDIR "/baseline/smartmaxsize")); + QCOMPARE(f.open(QIODevice::ReadOnly | QIODevice::Text), true); QTextStream stream(&f); -- cgit v0.12