Skip to content

add support for QNX 7.1/8.0#2953

Closed
pkleymonov-qnx wants to merge 4 commits intocatchorg:develfrom
qnx-ports:qnx-pr-v3.6.0
Closed

add support for QNX 7.1/8.0#2953
pkleymonov-qnx wants to merge 4 commits intocatchorg:develfrom
qnx-ports:qnx-pr-v3.6.0

Conversation

@pkleymonov-qnx
Copy link
Copy Markdown

@pkleymonov-qnx pkleymonov-qnx commented Feb 7, 2025

These changes facilitate porting of Catch2 for QNX7.1/8.0.
Build files are available at https://github.com/qnx-ports/build-files/tree/main/ports/Catch2

NOTE: QNX ports are only supported from a Linux host operating system

Create a workspace

mkdir -p ~/qnx_workspace && cd ~/qnx_workspace
git clone https://github.com/qnx-ports/build-files.git

Clone Catch2 repository from tested release version

git clone https://github.com/qnx-ports/Catch2.git

Or clone it from original repository

git clone https://github.com/catchorg/Catch2.git

Regenerate the amalgamated distribution (some tests are built against it)

cd Catch2
./tools/scripts/generateAmalgamatedFiles.py
cd -

Setup a Docker container

Pre-requisite:

# Build the Docker image and create a container
cd build-files/docker
./docker-build-qnx-image.sh
./docker-create-container.sh

# Now you are in the Docker container

Compile the port for QNX

cd ~/qnx_workspace
# Build Catch2 and install it in sysroot (QNX SDP)
make -C build-files/ports/Catch2 install JLEVEL=$(nproc)
# Or build Catch2 and install it in a staging area
make -C build-files/ports/Catch2 install JLEVEL=$(nproc) INSTALL_ROOT_nto=<PATH_TO_YOUR_STAGING_AREA> USE_INSTALL_ROOT=true

How to run tests

Copy (scp) Catch2 tests in to the QNX target.

cd ~/qnx_workspace

# define target IP address
TARGET_HOST=<target-ip-address-or-hostname>

# copy test binaries to your QNX target
scp -r $QNX_TARGET/aarch64le/usr/local/bin/Catch2_tests qnxuser@$TARGET_HOST:/data/home/qnxuser/
# or
scp -r $QNX_TARGET/x86_64/usr/local/bin/Catch2_tests qnxuser@$TARGET_HOST:/data/home/qnxuser/

Run tests on the target.

# ssh into the target
ssh qnxuser@$TARGET_HOST
## Run tests
cd /data/home/qnxuser/Catch2_tests/
python ./base_testsuite.py

Tips and triks.

With your spd you can create and run virtual x86_64 TARGET of QNX.

# source qnxsdp-env.sh
source ~/qnx800/qnxsdp-env.sh

# Install on linux host virtual machine like qemu/vxbox/vmware
# Create and run virtual target of QNX
# qemu
mkqnximage --type=qemu --arch=x86_64 --clean --run --force --python=yes
# or vmware
mkqnximage --type=vmware --arch=x86_64 --clean --run --force --python=yes
# or virtual box
mkqnximage --type=vbox --arch=x86_64 --clean --run --force --python=yes

Note: All tests have to return no error.

...
======================================================
Tests suites summary for Catch2 3.6.0
======================================================
# MAIN  Tests - ALL:76 PASS:68 FAIL:0 SKIP:8 [0:00:11.233883]
# EXTRA Tests - ALL:41 PASS:35 FAIL:0 SKIP:6 [0:00:07.610188]
# TOTAL: 117 [0:00:18.844071]
# PASS: 103
# FAIL: 0
# SKIP: 14
======================================================
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.98%. Comparing base (914aeec) to head (770a614).
⚠️ Report is 97 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2953      +/-   ##
==========================================
- Coverage   91.01%   90.98%   -0.03%     
==========================================
  Files         198      198              
  Lines        8599     8599              
==========================================
- Hits         7826     7823       -3     
- Misses        773      776       +3     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@pkleymonov-qnx pkleymonov-qnx marked this pull request as ready for review February 7, 2025 12:19
shahsb

This comment was marked as spam.

@ChrisThrasher
Copy link
Copy Markdown
Collaborator

What errors do you get when trying to compile the latest release on QNX?

@horenmar
Copy link
Copy Markdown
Member

horenmar commented Jul 6, 2025

Code changes: Sure, better autodetection for QNX support is welcome.

Build changes: Only if they come with QNX job in CI.

@horenmar horenmar closed this in 9048c24 Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants