summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-12-13 23:08:05 +0200
committerJuha Vuolle <juha.vuolle@insta.fi>2021-12-15 11:53:21 +0200
commitd68134dc320f3f6fc25973aea9e813e4088e4545 (patch)
treec1cd1f8033d8e7226582c28be66bf46883751c5c
parent52a03bcb3cad602175062456aca15ae9a16f6006 (diff)
downloadqtconnectivity-d68134dc320f3f6fc25973aea9e813e4088e4545.tar.gz
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 <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--tests/auto/qbluetoothdevicediscoveryagent/qbluetoothdevicediscoveryagent.pro2
-rw-r--r--tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro2
-rw-r--r--tests/auto/qlowenergycharacteristic/qlowenergycharacteristic.pro2
-rw-r--r--tests/auto/qlowenergycontroller/qlowenergycontroller.pro2
-rw-r--r--tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp3
-rw-r--r--tests/auto/qlowenergydescriptor/qlowenergydescriptor.pro2
-rw-r--r--tests/auto/shared/Info.macos.plist24
7 files changed, 36 insertions, 1 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>NSBluetoothAlwaysUsageDescription</key>
+ <string>Qt BT test wants to access your Bluetooth adapter</string>
+ <key>NSSupportsAutomaticGraphicsSwitching</key>
+ <true/>
+</dict>
+</plist>