From 17e233e7c3bbd13f455f9299d1b714da436d0806 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 5 Jun 2012 13:34:33 +0200 Subject: Make qmovie autotest build without widgets Change-Id: Ie53b183e99de08c3cc35f4932b7aabf4bf5b0940 Reviewed-by: Lars Knoll --- tests/auto/gui/image/qmovie/qmovie.pro | 3 ++- tests/auto/gui/image/qmovie/tst_qmovie.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro index fc2c5708b0..b02ba29298 100644 --- a/tests/auto/gui/image/qmovie/qmovie.pro +++ b/tests/auto/gui/image/qmovie/qmovie.pro @@ -1,7 +1,8 @@ CONFIG += testcase CONFIG += parallel_test TARGET = tst_qmovie -QT += widgets testlib +QT += testlib +!contains(QT_CONFIG, no-widgets): QT += widgets SOURCES += tst_qmovie.cpp MOC_DIR=tmp diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index e60d41f5ed..45ee38578c 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -44,7 +44,9 @@ #include +#ifndef QT_NO_WIDGETS #include +#endif #include class tst_QMovie : public QObject @@ -70,7 +72,9 @@ private slots: void jumpToFrame_data(); void jumpToFrame(); void changeMovieFile(); +#ifndef QT_NO_WIDGETS void infiniteLoop(); +#endif }; // Testing get/set functions @@ -167,6 +171,7 @@ void tst_QMovie::playMovie() connect(&movie, SIGNAL(finished()), this, SLOT(exitLoopSlot())); +#ifndef QT_NO_WIDGETS QLabel label; label.setMovie(&movie); label.show(); @@ -177,6 +182,7 @@ void tst_QMovie::playMovie() QCOMPARE(movie.state(), QMovie::NotRunning); QCOMPARE(movie.frameCount(), frameCount); +#endif } void tst_QMovie::jumpToFrame_data() @@ -203,6 +209,7 @@ void tst_QMovie::changeMovieFile() QVERIFY(movie.currentFrameNumber() == -1); } +#ifndef QT_NO_WIDGETS void tst_QMovie::infiniteLoop() { QLabel label; @@ -214,6 +221,7 @@ void tst_QMovie::infiniteLoop() QTestEventLoop::instance().enterLoop(1); QTestEventLoop::instance().timeout(); } +#endif QTEST_MAIN(tst_QMovie) #include "tst_qmovie.moc" -- cgit v1.2.3