summaryrefslogtreecommitdiffstats
path: root/tests/auto/integration/qaudiodecoderbackend
diff options
context:
space:
mode:
authorSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-06-08 11:39:06 +0300
committerSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-08-22 12:51:40 +0000
commitc341b2b25697f937280fe3620629ac3d32c19613 (patch)
tree79d08e0061ca341e5f5f23dccba8804e395a28a6 /tests/auto/integration/qaudiodecoderbackend
parentba79c575860231548b8fd8309c5f6d2b715860ca (diff)
Enable tests for boot2qt
The tests for boot2qt were disabled with commit b9bfe241cc3c3466ad250da80b2a7ccf087706a4. The tests can be enabled since qtdeclarative now fallbacks to software renderer if OpenGL is not supported. Two changes were needed to pass tests on boot2qt 1. Add option to disable tests requiring WAV format and use that in the boot2qt environment 2. Skip some tst_QPainterVideoSurface tests if GLContext is not supported by the platform Task-number: QTBUG-60268 Change-Id: I236207fedb505124a2c7edf0caccd85011ab1416 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/integration/qaudiodecoderbackend')
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/BLACKLIST8
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro8
-rw-r--r--tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp22
3 files changed, 30 insertions, 8 deletions
diff --git a/tests/auto/integration/qaudiodecoderbackend/BLACKLIST b/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
index 8b6712728..316c5a083 100644
--- a/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
+++ b/tests/auto/integration/qaudiodecoderbackend/BLACKLIST
@@ -1,10 +1,2 @@
# QTBUG-56796
windows
-
-[fileTest]
-# QTBUG-60268
-b2qt
-
-[deviceTest]
-# QTBUG-60268
-b2qt
diff --git a/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro b/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro
index 7464a8aa2..672bcfa6a 100644
--- a/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro
+++ b/tests/auto/integration/qaudiodecoderbackend/qaudiodecoderbackend.pro
@@ -9,5 +9,13 @@ TESTDATA += testdata/*
INCLUDEPATH += \
../../../../src/multimedia/audio
+HEADERS += \
+ ../shared/mediafileselector.h
+
SOURCES += \
tst_qaudiodecoderbackend.cpp
+
+boot2qt: {
+ # Yocto sysroot does not have gstreamer/wav
+ QMAKE_CXXFLAGS += -DWAV_SUPPORT_NOT_FORCED
+}
diff --git a/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp b/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
index 2af06b46c..1e582d14b 100644
--- a/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
+++ b/tests/auto/integration/qaudiodecoderbackend/tst_qaudiodecoderbackend.cpp
@@ -30,6 +30,8 @@
#include <QDebug>
#include "qaudiodecoder.h"
+#include "../shared/mediafileselector.h"
+
#define TEST_FILE_NAME "testdata/test.wav"
#define TEST_UNSUPPORTED_FILE_NAME "testdata/test-unsupported.avi"
#define TEST_CORRUPTED_FILE_NAME "testdata/test-corrupted.wav"
@@ -56,6 +58,9 @@ private slots:
void unsupportedFileTest();
void corruptedFileTest();
void deviceTest();
+
+private:
+ bool isWavSupported();
};
void tst_QAudioDecoderBackend::init()
@@ -67,14 +72,28 @@ void tst_QAudioDecoderBackend::initTestCase()
QAudioDecoder d;
if (!d.isAvailable())
QSKIP("Audio decoder service is not available");
+
+ qRegisterMetaType<QMediaContent>();
}
void tst_QAudioDecoderBackend::cleanup()
{
}
+bool tst_QAudioDecoderBackend::isWavSupported()
+{
+#ifdef WAV_SUPPORT_NOT_FORCED
+ return !MediaFileSelector::selectMediaFile(QStringList() << QFINDTESTDATA(TEST_FILE_NAME)).isNull();
+#else
+ return true;
+#endif
+}
+
void tst_QAudioDecoderBackend::fileTest()
{
+ if (!isWavSupported())
+ QSKIP("Sound format is not supported");
+
QAudioDecoder d;
if (d.error() == QAudioDecoder::ServiceMissingError)
QSKIP("There is no audio decoding support on this platform.");
@@ -411,6 +430,9 @@ void tst_QAudioDecoderBackend::corruptedFileTest()
void tst_QAudioDecoderBackend::deviceTest()
{
+ if (!isWavSupported())
+ QSKIP("Sound format is not supported");
+
QAudioDecoder d;
if (d.error() == QAudioDecoder::ServiceMissingError)
QSKIP("There is no audio decoding support on this platform.");