Skip to content

VRT unit testing#65

Open
JOOpdenhoevel wants to merge 18 commits intoXilinx:devfrom
JOOpdenhoevel:feature/vrt-unit-testing
Open

VRT unit testing#65
JOOpdenhoevel wants to merge 18 commits intoXilinx:devfrom
JOOpdenhoevel:feature/vrt-unit-testing

Conversation

@JOOpdenhoevel
Copy link
Copy Markdown

This PR introduces the testing infrastructure for VRT, using GTest as the unit testing framework and gcov/lcov for coverage reporting.

The test suite already covers large portions of the code base, around 62% of lines and functions each. This is especially made possible by a small ZeroMQ server written in Python that is inserted into a custom VBIN container as the vpp_emu or vpp_sim executable. This way, you can in theory test all aspects regarding emulation and simulation in a GitHub Actions workflow, without access to Vivado or a dependency on the linker. However, the functionality of this small server is still relatively simple, which is one of the reasons why not everything is tested yet.

The other reason is that I had to disable the two test cases that actually try to "run" and await a kernel because Claude Code has used the broken Device::getKernel method to fetch the kernel objects. This method is broken since it fetches the kernel objects directly from the internal storage of the Device class, where the kernels miss a valid Platform and ZMQ server handle. The quick and easy fix would be set these fields just like in Kernel::Kernel, but I think that the actual, underlying issue is that the device object is storing invalid kernel objects, which should not be the case. However, fixing this is a separate contribution. I'm therefore disabling these test cases for now and will come back to this issue with a separate PR; This is an issue that should definitely be fixed IMO.

Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
…or GitHub Action workflows

Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
@JOOpdenhoevel
Copy link
Copy Markdown
Author

I've looked at the Device::getKernel issue with a fresh mind and found that the fix is actually pretty simple. I thus have already fixed it.

@amd-vserbu
Copy link
Copy Markdown

amd-vserbu commented Apr 23, 2026

Could you add a cmake flag for whether the tests should be built or not? Can default to on, but should be disabled in scripts/pconfigure.sh.

Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
Signed-off-by: Jan-Oliver Opdenhövel <Jan-Oliver.Opdenhovel@amd.com>
@JOOpdenhoevel
Copy link
Copy Markdown
Author

Done. I had already included this for libslash and VRTD in #68, but here it was still missing.

Comment thread submodules/AVED
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is AVED added as submodule here? I thought we already carried AVED as submodule for firmware/shell builds

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.

3 participants