Skip to content

VRT unit testing

VRT unit testing #5

Workflow file for this run

# ##################################################################################################
# The MIT License (MIT)
# Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ##################################################################################################
name: VRT unit testing
on:
push:
branches:
- main
- dev
pull_request:
jobs:
vrt_unit_tests:
runs-on: ubuntu-24.04
permissions: { contents: read }
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: "true"
- name: Install dependencies
run: |
sudo apt update
sudo apt upgrade -y
sudo apt install -y cmake pkg-config ninja-build \
libxml2-dev libzmq3-dev libjsoncpp-dev zlib1g-dev \
libsystemd-dev libinih-dev libcli11-dev lcov python3-zmq
- name: Build and run VRT unit tests
run: |
mkdir vrt/build
cd vrt/build
cmake -DVRT_INCLUDE_VRTD=1 -DVRTD_INCLUDE_LIBSLASH=1 -DENABLE_COVERAGE=1 ..
make unit_tests -j$(nproc)
cd tests && ctest --output-on-failure
- name: Generate coverage report
run: |
cd vrt/build
lcov --capture --directory . --output-file coverage.info \
--ignore-errors mismatch --ignore-errors negative
lcov --remove coverage.info \
'/usr/*' '*/build/_deps/*' '*/vrtd/*' '*/tests/*' \
--output-file coverage.filtered.info \
--ignore-errors unused
genhtml coverage.filtered.info --output-directory coverage-report
lcov --list coverage.filtered.info
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: vrt-coverage-report
path: vrt/build/coverage-report/