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

WIP Add test infrastructure #1091

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

WIP Add test infrastructure #1091

wants to merge 11 commits into from

Conversation

tfcollins
Copy link
Contributor

The PR adds core infrastructure to introduce unit tests. It adds

  • CMake + CTest pieces for testing targets
  • Basic example test
  • Coverage target for LCOV based testing
  • GH action to run non-hardware tests

@rgetz
Copy link
Contributor

rgetz commented Nov 30, 2023

You need to define

 ./CMakeLists.txt:option(TESTS "Enabling unit testing" OFF)
./CMakeLists.txt:option(TESTS_DEBUG "Enable test debugging" OFF)
./CMakeLists.txt:option(TESTS_COVERAGE "Enable coverage tracing when testing" OFF)

in the `README_BUILD" file.

@tfcollins
Copy link
Contributor Author

You need to define

 ./CMakeLists.txt:option(TESTS "Enabling unit testing" OFF)
./CMakeLists.txt:option(TESTS_DEBUG "Enable test debugging" OFF)
./CMakeLists.txt:option(TESTS_COVERAGE "Enable coverage tracing when testing" OFF)

in the `README_BUILD" file.

Added

@rgetz
Copy link
Contributor

rgetz commented Dec 2, 2023

is the plan to connect the machinery to other repos so you can test against tinyiiod/emu-iio? (Until that's integrated in here directly?)

pcercuei and others added 9 commits December 14, 2023 17:55
The CLOCK_REALTIME clock may jump in time, which can be a huge problem
when computing timeouts. Use the CLOCK_MONOTONIC one instead, which does
not have this problem.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
When the buffer creation failed, entry->buf was left to whatever error
pointer it had previously, instead of being reset to NULL; cleanup code
would subsequently try to destroy the buffer once again with an invalid
pointer.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
IIOD v0.x supports enqueueing cyclic blocks, but it needs to know about
it when the iio_buffer is opened through the "OPEN" command. As
iiod-client calls this command when the buffer is to be enabled, pass an
extra "cyclic" parameter to .buffer_enable(), always set to "false" for
now.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Instead of continuously sending the same block again and again, set the
"cyclic" parameter of the .enable_buffer() backend callback to the value
of the "cyclic" parameter of the last call to iio_buffer_enqueue().

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
Signed-off-by: Travis F. Collins <travis.collins@analog.com>
@SRaus
Copy link
Contributor

SRaus commented Mar 18, 2024

Just a question about this unit testing framework.

Why does GitHub Action was chosen?

Do we have in plan to add local runners for those unit tests? If not, we can check here what are the costs https://confluence.analog.com/display/DEVTOOLS/Github+Actions%3A+Usage+and+Cost
(*The page was not updated since a while - now we are a bit over the "free limit")

In other repos, we have implemented an extra step in Azure Pipeline for unit tests - still docker containers on cloud, any OS, fit in the existing payment plan. Check the example for No-OS.

@tfcollins
Copy link
Contributor Author

Just a question about this unit testing framework.

Why does GitHub Action was chosen?

Do we have in plan to add local runners for those unit tests? If not, we can check here what are the costs https://confluence.analog.com/display/DEVTOOLS/Github+Actions%3A+Usage+and+Cost (*The page was not updated since a while - now we are a bit over the "free limit")

In other repos, we have implemented an extra step in Azure Pipeline for unit tests - still docker containers on cloud, any OS, fit in the existing payment plan. Check the example for No-OS.

@SRaus GHA is the general direction of the company and even Microsoft. Its better integrated and doesn't require multiple logins. As for costs you missed the top paragraph of that page:

https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions

GitHub Actions usage is free for standard GitHub-hosted runners in public repositories, and for self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage for use with GitHub-hosted runners, depending on the account's plan. Any usage beyond the included amounts is controlled by spending limits.

Other reference: https://github.com/orgs/community/discussions/70492

Since libiio is public, GHA is free.

As for self hosted runners, this shouldn't be necessary for libiio as it doesn't require special tools (MATLAB, Vivado, Quartus) to build. Hardware testing is a different story and isn't even covered by Azure Pipelines.

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.

4 participants