Changed to use QFINDTESTDATA and TESTDATA.
Change-Id: I8684bc191cf8ffb8b531456e32047d582ebc018c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
MOC_DIR=tmp
QT += widgets widgets-private core-private gui-private network testlib
RESOURCES += qimagereader.qrc
-DEFINES += SRCDIR=\\\"$$PWD\\\"
win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
win32-msvc.net:QMAKE_CXXFLAGS -= -Zm300
win32-msvc.net:QMAKE_CXXFLAGS += -Zm1100
-wince*: {
- images.files = images
- images.path = .
-
- imagePlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*.dll
- imagePlugins.path = imageformats
-
- DEPLOYMENT += images imagePlugins
- DEFINES += SRCDIR=\\\".\\\"
-}
+TESTDATA += images/* baseline/*
void preserveTexts();
private:
+ QString prefix;
QTemporaryDir m_temporaryDir;
};
-static const QLatin1String prefix(SRCDIR "/images/");
-
// helper to skip an autotest when the given image format is not supported
#define SKIP_IF_UNSUPPORTED(format) do { \
if (!QByteArray(format).isEmpty() && !QImageReader::supportedImageFormats().contains(format)) \
void tst_QImageReader::init()
{
+ prefix = QFINDTESTDATA("images/");
QVERIFY(m_temporaryDir.isValid());
}
!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
!contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG
-wince*: {
- addFiles.files = animations\\*
- addFiles.path = animations
- DEPLOYMENT += addFiles
-}
-
RESOURCES += resources.qrc
-
+TESTDATA += animations/*
QFETCH(QString, fileName);
QFETCH(int, frameCount);
- QMovie movie(fileName);
+ QMovie movie(QFINDTESTDATA(fileName));
QCOMPARE(movie.state(), QMovie::NotRunning);
movie.setSpeed(1000);
QT = core testlib
cross_compile: DEFINES += QMAKE_CROSS_COMPILED
+
+TESTDATA += testdata/*
tst_qmake::tst_qmake()
{
+}
+
+tst_qmake::~tst_qmake()
+{
+
+}
+
+void tst_qmake::initTestCase()
+{
QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
QString cmd = QString("%2/qmake \"QT_VERSION=%1\"").arg(QT_VERSION).arg(binpath);
#ifdef Q_CC_MSVC
#else
test_compiler.setBaseCommands( "make", cmd );
#endif
- QDir dir;
- base_path = dir.currentPath();
-}
-
-tst_qmake::~tst_qmake()
-{
-
-}
-
-void tst_qmake::initTestCase()
-{
+ QString tmpFile = QFINDTESTDATA("testdata");
+ base_path = tmpFile.left(tmpFile.lastIndexOf('/'));
}
void tst_qmake::cleanupTestCase()