C
Setting Up and Using QBSP Test Bench
The Squish-based QBSP Test Bench helps you to verify that QBSPs actually work and applications can be deployed to the target device from Qt Creator.
To download the QBSP Test Bench package, go to Qt Partner Portal. Log in or register as a Qt user, if you haven't done that yet. Then download the QBSP Test Bench package. The package is titled tqtc-qbsp-testbench-ddmmyy.7z. Make sure that the Squish license is available to you.
Unzip the package. Then run the setup_install.py
script to install the required Qt and Qt Creator versions, and flash the image to your hardware device.
If you choose USB as the device connection type in Linux, make sure USB is configured as described in Setting Up USB Access to Embedded Devices. If you choose Ethernet, the installer asks for the IP address of the device that is being tested. If you don't know it yet, leave the field empty and add the address later on.
On Windows, you need to run the script as an administrator. To do this, search for "cmd" and right-click on the command prompt and select Run as administrator. Then execute the script, for example as follows:
C:\Users\<username>\workdir\tqtc-qbsp-testbench>python3 setup_install.py ..\..\Downloads\meta-b2qt-embedded-qbsp-x86_64-mingw32-stm32mp15-disco-6.8.0.qbsp
~$ cd tqtc-qbsp-testbench/ ~/tqtc-qbsp-testbench $ ./setup_install.py /home/<username>/workdir/testbenchimages/meta-b2qt-embedded-qbsp-x86_64-stm32mp15-disco-6.8.0.qbsp Configuration settings will be written into /home/<username>/testbench.config file where settings can be later edited. Please input setting values matching your setup. ; Absolute path of directory, where Qt will be installed qt installation_location: /home/<username>/workdir/testbench/qt ; Absolute path of Qt installer binary file (leave empty to attempt automatic Qt installer download) qt installer_location: ; Qt credentials, which will be used with Qt installer qt <username>: firstname.lastname@example.com qt password: ; Qt version which QBSP file is based on QBSP image_qt_version: 6.8.0 ; The name of the hardware which is supported by the QBSP under test device hardware_name: stm32mp15-disco ; connection_type can be ethernet or usb device connection_type: ethernet device ethernet_address: 192.168.1.113 User configuration read from /home/<username>/testbench.config Attempting to download Qt installer --2023-03-01 15:41:29-- https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run Resolving download.qt.io (download.qt.io)... 77.86.162.2 Connecting to download.qt.io (download.qt.io)|77.86.162.2|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/online_installers/4.5/qt-unified-linux-x64-4.5.1-online.run [following] --2023-03-01 15:41:29-- https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/archive/online_installers/4.5/qt-unified-linux-x64-4.5.1-online.run Resolving www.nic.funet.fi (www.nic.funet.fi)... 193.166.3.3, 2001:708:10:8::3 Connecting to www.nic.funet.fi (www.nic.funet.fi)|193.166.3.3|:443... connected. HTTP request sent, awaiting response... 200 OK . . . [12618] Installation finished! [12621] Headless installation: skip wizard page item addition: "LaunchQtCreatorCheckBoxForm" [12621] Components installed successfully. Installation complete. Install dir: '/home/<username>/workdir/testbench/qt' found Please update image from /home/<username>/workdir/testbench/qt/6.8.0/Boot2Qt/stm32mp15-disco/images to your stm32mp15-disco hardware and run suite_qbsp_testbench with Squish. /home/<username>/workdir/testbench/qt/Tools/b2qt/b2qt-flashing-wizard tool installed. Please use it to write the installed image to memory card. Please use a Squish version that is based on the same Qt version as the installed Qt Creator: Qt Creator 12.0.2 based on Qt 6.6.0
Once the installation is complete, the installer launches Qt Creator's Boot to Qt Flashing Wizard, which you can use to write the device image to a memory card. If you already have the image on the device, skip this step.
An important detail in the installer output is "based on Qt 6.6.0". You need this piece of information later on when installing Squish.
Note: On Windows, the installer launches a pop-up window where you can see the Qt version. Installation continues when you close the window.
If the script doesn't print Qt Creator version, you can also check it manually:
$ <qt installation path>/Tools/QtCreator/bin/qtcreator -version 2> >(grep "based on") Qt Creator 12.0.2 based on Qt 6.6.0
Alternatively, you can also launch Qt Creator and select Help > About Qt Creator to verify the version information.
If necessary, you can check and edit the created testbench.config
from user's home folder before continuing. On Linux it's in ~/testbench.config
and on Windows the location is C:\Users\[<username>]\testbench.config
.
$ cat ~/testbench.config [qt] ; Absolute path of directory, where Qt will be installed installation_location = /home/<username>/workdir/testbench/qt ; Absolute path of Qt installer binary file (leave empty to attempt automatic Qt installer download) installer_location = ; Qt credentials, which will be used with Qt installer username = [your Qt account username] password = [your Qt account password] [QBSP] ; Qt version which QBSP file is based on image_qt_version = 6.8.0 [device] ; The name of the hardware which is supported by the QBSP under test hardware_name = stm32mp15-disco ; connection_type can be ethernet or usb connection_type = ethernet ethernet_address = [ip address of your device under testing]
Warning: Use absolute paths in testbench.config
because paths such as ~/workdir/testbench/qt
won't work in this case.
Installing Squish
To run the tests successfully, make sure that these two preconditions are met:
- The installed Squish version needs to be built for the Qt version used in the installed Qt Creator (in this example it is Qt 6.4).
- Qt Creator version (or more specifically, its GUI) needs to match the Qt Creator version that the Squish Test Suite was designed for:
setup_install.py
tries to determine and install the correct Qt Creator version for you.
Squish installation packages are available in Qt Customer Portal. In this example installation you need the latest version which is compatible with Qt 6.4, so download, give execute permissions, and install squish-7.2.1-qt64x-linux64.run
.
~/Downloads$ chmod +x squish-7.2.1-qt64x-linux64.run ~/Downloads$ ./squish-7.2.1-qt64x-linux64.run
Note: For Windows, choose the Microsoft Visual C++ version of Squish, that is squish-7.2.1-qt64x-win64-msvc142.exe
.
- In License view, Select Local License.
- Out of the available components, you only need Squish Tools to execute the Squish Test Suite from the command line. However, to investigate possible test failures, and store and view test results, we recommend installing also Squish IDE. Be prepared for over 1GB of hard disk usage when performing the full installation.
- In Script Languages view, accept Python version 3.10.
- In Installation Folder view, Select the installation directory and proceed with the installation.
Executing the Squish Test Suite
On Linux, start the squish server as follows:
~$ ./squish-for-qt-7.2.1/bin/squishserver &
Use the squishrunner
command to run the Squish Test Suite:
~$ ./squish-for-qt-7.2.1/bin/squishrunner --testsuite tqtc-qbsp-testbench/suite_qbsp_testbench/ 2022-10-04T15:54:11 START Start 'suite_testsuite' Test 'suite_testsuite' started 2022-10-04T15:54:11 START_TEST_CASE Start 'tst_install' Test 'tst_install' started (tst_install) ... 2022-10-04T15:05:17 END End 'suite_testsuite' End of test 'suite_testsuite' ******************************************************* Summary: Number of Test Cases: 15 Number of Tests: 30 Number of Errors: 0 Number of Fatals: 0 Number of Fails: 0 Number of Passes: 30 Number of Expected Fails: 0 Number of Unexpected Passes: 0 Number of Warnings: 0 *******************************************************
On Windows, open a new command prompt window for the squish server:
C:\Users\<username>\Squish for Qt 7.2.1\bin>squishserver.exe 15:29:19:834 Info: Starting server of Squish version 7.2.1. 15:29:19:849 Info: Listening on 0.0.0.0:4322 15:29:19:849 Info: Listening on ws://127.0.0.1:63535?pQoRUcLoosOUVMcCZR0c 15:29:19:849 Info: Announcing server presence via SSDP
Use the squishrunner
command to run the Squish Test Suite:
C:\Users\<username>\Squish for Qt 7.2.1\bin>squishrunner.exe --testsuite ..\..\workdir\tqtc-qbsp-testbench\suite_qbsp_testbench
Note: Adding --reportgen html,[absolute_path_to_report_dir]
to the command line generates an HTML report, which may give more helpful details in problem situations. Archiving the folder is a good way to share results to others.
You can also run the Squish Test Suite from Squish IDE:
~/workdir/squish-for-qt-7.2.1 $ ./squishide
After the full Squish Test Suite has been executed, you can also run single test cases from the Squish IDE.
Available under certain Qt licenses.
Find out more.