diff options
author | Tomasz Kozłowski <tomasz.kozlowski@qt.io> | 2024-03-20 09:10:26 +0100 |
---|---|---|
committer | Tomasz Kozłowski <tomasz.kozlowski@qt.io> | 2024-05-06 09:44:38 +0100 |
commit | d28eb457f866415132cd8144f1cbca3694b0d86f (patch) | |
tree | 0b5bcb9a514c09b479af9bfa95cfc559e3a4b807 | |
parent | 68d3b6606864226fb73ecba07f6ff215ec533b60 (diff) |
Add condition to QProcess usage
QProcess is not available on VxWorks. Because of that,
add skip for tests if it is not configured.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Ifc152620147ee35b225db2746abffb07f819c890
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
-rw-r--r-- | tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index 510122a94..948349236 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -13,7 +13,9 @@ #include <qvideosink.h> #include <qvideoframe.h> #include <qaudiooutput.h> +#if QT_CONFIG(process) #include <qprocess.h> +#endif #include <private/qglobal_p.h> #ifdef QT_FEATURE_network #include <qtcpserver.h> @@ -182,7 +184,9 @@ private: QUrl selectVideoFile(const QStringList &mediaCandidates); bool canCreateRtspStream() const; +#if QT_CONFIG(process) std::unique_ptr<QProcess> createRtspStreamProcess(QString fileName, QString outputUrl); +#endif void detectVlcCommand(); // one second local wav file @@ -1078,6 +1082,9 @@ void tst_QMediaPlayerBackend::playAndSetSource_emitsExpectedSignalsAndStopsPlayb void tst_QMediaPlayerBackend:: play_createsFramesWithExpectedContentAndIncreasingFrameTime_whenPlayingRtspMediaStream() { +#if !QT_CONFIG(process) + QSKIP("This test requires QProcess support"); +#else if (!canCreateRtspStream()) QSKIP("Rtsp stream cannot be created"); @@ -1138,6 +1145,7 @@ void tst_QMediaPlayerBackend:: QCOMPARE(player.playbackState(), QMediaPlayer::StoppedState); QCOMPARE(errorSpy.size(), 0); +#endif //QT_CONFIG(process) } void tst_QMediaPlayerBackend::play_waitsForLastFrameEnd_whenPlayingVideoWithLongFrames() @@ -2971,6 +2979,7 @@ void tst_QMediaPlayerBackend::setMedia_setsVideoSinkSize_beforePlaying() QCOMPARE(spy2.size(), 1); } +#if QT_CONFIG(process) std::unique_ptr<QProcess> tst_QMediaPlayerBackend::createRtspStreamProcess(QString fileName, QString outputUrl) { @@ -3000,6 +3009,7 @@ std::unique_ptr<QProcess> tst_QMediaPlayerBackend::createRtspStreamProcess(QStri return process; } +#endif //QT_CONFIG(process) void tst_QMediaPlayerBackend::play_playsRotatedVideoOutput_whenVideoFileHasOrientationMetadata_data() { |