Add use of TESTDATA feature to integration tests

Use TESTDATA and QFINDTESTDATA in integration tests. Also remove
unused path defines from unit test .pro files.

Change-Id: I46dc6a96b918e989acf79eb3bd23c53125c7c3d6
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
Kalle Juhani Lehtonen
2012-03-13 11:46:44 +10:00
committed by Qt by Nokia
parent 8e82f57c6a
commit 1f1bdbec82
11 changed files with 15 additions and 23 deletions

View File

@@ -6,7 +6,8 @@ CONFIG += no_private_qt_headers_warning
# This is more of a system test
# CONFIG += testcase
DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\"
SOURCES += \
tst_qmediaplayerbackend.cpp
TESTDATA += testdata/*

View File

@@ -49,10 +49,6 @@
//TESTED_COMPONENT=src/multimedia
#ifndef TESTDATA_DIR
#define TESTDATA_DIR "./"
#endif
QT_USE_NAMESPACE
/*
@@ -132,9 +128,8 @@ void tst_QMediaPlayerBackend::init()
void tst_QMediaPlayerBackend::initTestCase()
{
QFileInfo wavFile(QLatin1String(TESTDATA_DIR "testdata/test.wav"));
if (!wavFile.exists())
wavFile = QFileInfo(QLatin1String("testdata/test.wav"));
const QString testFileName = QFINDTESTDATA("testdata/test.wav");
QFileInfo wavFile(testFileName);
QVERIFY(wavFile.exists());
@@ -465,7 +460,8 @@ void tst_QMediaPlayerBackend::seekPauseSeek()
TestVideoSurface *surface = new TestVideoSurface;
player.setVideoOutput(surface);
QFileInfo videoFile(QLatin1String(TESTDATA_DIR "testdata/colors.mp4"));
const QString testFileName = QFINDTESTDATA("testdata/colors.mp4");
QFileInfo videoFile(testFileName);
QVERIFY(videoFile.exists());
player.setMedia(QUrl::fromLocalFile(videoFile.absoluteFilePath()));
@@ -540,7 +536,8 @@ void tst_QMediaPlayerBackend::probes()
QVERIFY(videoProbe->setSource(player));
QVERIFY(audioProbe->setSource(player));
QFileInfo videoFile(QLatin1String(TESTDATA_DIR "testdata/colors.mp4"));
const QString testFileName = QFINDTESTDATA("testdata/colors.mp4");
QFileInfo videoFile(testFileName);
QVERIFY(videoFile.exists());
player->setMedia(QUrl::fromLocalFile(videoFile.absoluteFilePath()));
QTRY_COMPARE(player->mediaStatus(), QMediaPlayer::LoadedMedia);