summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-04-29 09:47:57 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-04-29 11:35:51 +0200
commit1baceb8774a66aedd1b868707dbf1d05dca74b5b (patch)
tree8a55fe492849527205003db42f9f20d0ae6990b1 /tests
parent1dd587965dceb81508f6e22989163c072497f5b3 (diff)
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 <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtexttospeech/tst_qtexttospeech.cpp6
-rw-r--r--tests/auto/qvoice/tst_qvoice.cpp6
2 files changed, 12 insertions, 0 deletions
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 <QSignalSpy>
#include <QMediaDevices>
#include <QAudioDevice>
+#include <QOperatingSystemVersion>
#include <qttexttospeech-config.h>
#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 <QTest>
#include <QTextToSpeech>
+#include <QOperatingSystemVersion>
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");
}
}