From 1baceb8774a66aedd1b868707dbf1d05dca74b5b Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 29 Apr 2022 09:47:57 +0200 Subject: Workaround for iOS engine on macOS 10.14 The documentation claims that the AVFoundation based frameworks are available from macOS 10.14 onwards, but the API for getting the voices returns nothing. Handle that in the test case for now. Ideally, our plugin infrastructure would allow plugins to report such conditions so that the respective engine gets ignored. Change-Id: I0d7ab79acf41a9aea752e1789a74209faf689d3c Reviewed-by: Volker Hilsheimer --- tests/auto/qtexttospeech/tst_qtexttospeech.cpp | 6 ++++++ tests/auto/qvoice/tst_qvoice.cpp | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/auto/qtexttospeech/tst_qtexttospeech.cpp b/tests/auto/qtexttospeech/tst_qtexttospeech.cpp index 5a2cf7b..b0a6952 100644 --- a/tests/auto/qtexttospeech/tst_qtexttospeech.cpp +++ b/tests/auto/qtexttospeech/tst_qtexttospeech.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #if QT_CONFIG(speechd) @@ -122,6 +123,11 @@ void tst_QTextToSpeech::init() QSKIP("speechd engine reported a backend error, " "make sure the speech-dispatcher service is running!"); } + } else if (engine == "ios" + && QOperatingSystemVersion::current() <= QOperatingSystemVersion::MacOSMojave) { + QTextToSpeech tts(engine); + if (!tts.availableLocales().count()) + QSKIP("iOS engine is not functional on macOS <= 10.14"); } } diff --git a/tests/auto/qvoice/tst_qvoice.cpp b/tests/auto/qvoice/tst_qvoice.cpp index 0518a13..f0a61b6 100644 --- a/tests/auto/qvoice/tst_qvoice.cpp +++ b/tests/auto/qvoice/tst_qvoice.cpp @@ -37,6 +37,7 @@ #include #include +#include class tst_QVoice : public QObject { @@ -73,6 +74,11 @@ void tst_QVoice::init() QSKIP("speechd engine reported a backend error, " "make sure the speech-dispatcher service is running!"); } + } else if (engine == "ios" + && QOperatingSystemVersion::current() <= QOperatingSystemVersion::MacOSMojave) { + QTextToSpeech tts(engine); + if (!tts.availableLocales().count()) + QSKIP("iOS engine is not functional on macOS <= 10.14"); } } -- cgit v1.2.3