From d68134dc320f3f6fc25973aea9e813e4088e4545 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Mon, 13 Dec 2021 23:08:05 +0200 Subject: Add Info.plists to autotests which require bluetooth usage key This is needed to run the test cases on macOS 12. Also enable the tst_qlowenergycontroller test to run even if the sensor tag device is not found; the test contains functions that don't use it (the ones that do use it will skip). Task-number: QTBUG-98817 QTBUG-98816 Change-Id: I41369b7bfcea4de6c47428657881d9bab05a093e Reviewed-by: Qt CI Bot Reviewed-by: Alex Blasche --- .../qbluetoothdevicediscoveryagent.pro | 2 ++ .../qbluetoothservicediscoveryagent.pro | 2 ++ .../qlowenergycharacteristic.pro | 2 ++ .../qlowenergycontroller/qlowenergycontroller.pro | 2 ++ .../tst_qlowenergycontroller.cpp | 3 ++- .../qlowenergydescriptor/qlowenergydescriptor.pro | 2 ++ tests/auto/shared/Info.macos.plist | 24 ++++++++++++++++++++++ 7 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tests/auto/shared/Info.macos.plist diff --git a/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro b/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro index 900bb5e9..e221ba74 100644 --- a/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro +++ b/tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro @@ -2,5 +2,7 @@ SOURCES += tst_qbluetoothdevicediscoveryagent.cpp TARGET=tst_qbluetoothdevicediscoveryagent CONFIG += testcase +macos: QMAKE_INFO_PLIST = ../shared/Info.macos.plist + QT = core concurrent bluetooth-private testlib osx:QT += widgets diff --git a/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro b/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro index 7d4eba6f..4fd115bf 100644 --- a/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro +++ b/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro @@ -2,6 +2,8 @@ SOURCES += tst_qbluetoothservicediscoveryagent.cpp TARGET = tst_qbluetoothservicediscoveryagent CONFIG += testcase +macos: QMAKE_INFO_PLIST = ../shared/Info.macos.plist + QT = core concurrent bluetooth testlib osx:QT += widgets diff --git a/tests/auto/qlowenergycharacteristic/qlowenergycharacteristic.pro b/tests/auto/qlowenergycharacteristic/qlowenergycharacteristic.pro index 24106573..98562724 100644 --- a/tests/auto/qlowenergycharacteristic/qlowenergycharacteristic.pro +++ b/tests/auto/qlowenergycharacteristic/qlowenergycharacteristic.pro @@ -2,6 +2,8 @@ SOURCES += tst_qlowenergycharacteristic.cpp TARGET = tst_qlowenergycharacteristic CONFIG += testcase +macos: QMAKE_INFO_PLIST = ../shared/Info.macos.plist + QT = core bluetooth testlib diff --git a/tests/auto/qlowenergycontroller/qlowenergycontroller.pro b/tests/auto/qlowenergycontroller/qlowenergycontroller.pro index 7a67e8e4..a3d67ec9 100644 --- a/tests/auto/qlowenergycontroller/qlowenergycontroller.pro +++ b/tests/auto/qlowenergycontroller/qlowenergycontroller.pro @@ -8,6 +8,8 @@ CONFIG += testcase SOURCES += tst_qlowenergycontroller.cpp +macos: QMAKE_INFO_PLIST = ../shared/Info.macos.plist + osx|ios { QT += widgets } diff --git a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp index bc74c693..08590a31 100644 --- a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp +++ b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp @@ -176,7 +176,8 @@ void tst_QLowEnergyController::initTestCase() } } - QVERIFY2(deviceFound, "Cannot find remote device."); + if (!deviceFound) + qWarning() << "Unable to find the TI sensor tag device, will skip most of the test"; // These are the services exported by the TI SensorTag #ifndef Q_OS_MAC diff --git a/tests/auto/qlowenergydescriptor/qlowenergydescriptor.pro b/tests/auto/qlowenergydescriptor/qlowenergydescriptor.pro index 81ec9566..00ebe5c2 100644 --- a/tests/auto/qlowenergydescriptor/qlowenergydescriptor.pro +++ b/tests/auto/qlowenergydescriptor/qlowenergydescriptor.pro @@ -2,5 +2,7 @@ SOURCES += tst_qlowenergydescriptor.cpp TARGET = tst_qlowenergydescriptor CONFIG += testcase +macos: QMAKE_INFO_PLIST = ../shared/Info.macos.plist + QT = core bluetooth testlib diff --git a/tests/auto/shared/Info.macos.plist b/tests/auto/shared/Info.macos.plist new file mode 100644 index 00000000..e447b77c --- /dev/null +++ b/tests/auto/shared/Info.macos.plist @@ -0,0 +1,24 @@ + + + + + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundlePackageType + APPL + CFBundleSignature + ???? + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSPrincipalClass + NSApplication + NSBluetoothAlwaysUsageDescription + Qt BT test wants to access your Bluetooth adapter + NSSupportsAutomaticGraphicsSwitching + + + -- cgit v1.2.1