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

How to run test suite against the installed project #334

Closed
bdrung opened this issue Mar 10, 2023 · 3 comments
Closed

How to run test suite against the installed project #334

bdrung opened this issue Mar 10, 2023 · 3 comments

Comments

@bdrung
Copy link
Contributor

bdrung commented Mar 10, 2023

I am working on packaging nvme-stas for Debian/Ubuntu (see https://bugs.debian.org/1032650). Debian/Ubuntu has autopkgtest for running test against the installed binary package. Can you add documentation how to run the test cases against the installed nvme-stas?

@martin-belanger
Copy link
Collaborator

I'm not familiar with autopkgtest. The tests are part of the source repo and are embedded in meson.build files. Are you saying that autopkgtest allows one to run tests without having access to the source repo? How does that work? Can you point me to a project where this is used.

@bdrung
Copy link
Contributor Author

bdrung commented Mar 10, 2023

Some information about autopkgtest:

You specify which packages you need installed in your test bed and maybe what kind of restrictions you need in your test bed and what to run for the test. When running the test, the current working directory contains the source package content (which is the git export plus the debian directory).

@martin-belanger
Copy link
Collaborator

Hi @bdrung - Hope this will answer your question.

Basic testing is done using meson. From the directory where the source package content is located, run the following commands.

BUILD_DIR=".build"
meson setup ${BUILD_DIR}
meson test -C ${BUILD_DIR}

The above commands have been added to the Makefile for convenience and can be run simply with:

make test

Coverage testing is also available, but it is recommended to run that in a VM as this may leave the host computer in a weird state if something were to go wrong. Additional packages are required to run Coverage testing (see: TESTING.md). The command to run coverage testing is:

make coverage

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

No branches or pull requests

2 participants