Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for QNX 7.1/8.0 #2953

Open
wants to merge 4 commits into
base: devel
Choose a base branch
from

Conversation

pkleymonov-qnx
Copy link

@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
======================================================

Copy link

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).

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     

@pkleymonov-qnx pkleymonov-qnx marked this pull request as ready for review February 7, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant