Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unit test tooling in Hamlib

Open
#2,004 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@mikaelnousiainen is already working on this.

Since Feb 27, 2026.

Assessment

This issue has not been assessed yet.

Description

Question

As a part of the ARDC improvement project tasks (for example task #1940), I'd very much like to start writing unit tests to verify the new application logic and features work as expected. This kind of test code is tightly-coupled with the Hamlib C (or potentially C++ API bindings) code, so it's beneficial that it is written in the same language as the original code, as it will be calling the public API functions of Hamlib directly.

Currently, the only test code that Hamlib codebase contains, are the simulators (which are more in the category of integration or system testing) and some Python test code that primarily tests the Python bindings (again, more for integration/system testing I'd argue).

In order to help writing unit tests, I'd propose we use some simple unit testing framework that supports both C and C++ testing to get the following benefits:

  1. clear structure for declaring and grouping tests
  2. standardized test assertions
  3. standardized way to run tests
  4. test result reporting (success / failure with error messages)
  5. integration with autotools (current build framework) -> automake uses TAP protocol
  6. integration with CI (GitHub Actions) -> GHA uses JUnit reporting for test results

One possible choice is to go with a very simple, single-header library, such as Acutest: https://github.com/mity/acutest

Please see the GitHub README of Acutest for examples on assertions and how tests are declared - it uses simple C macros for most things (just like many other C/C++ unit test frameworks I've seen), but is otherwise very "unintrusive" as it's just a single header file we can include in the sources. Additionally, it includes simple support for both TAP and JUnit reporting. Both C and C++ are supported.

Other suggestions are welcome!

Dominant language
C
Stars
851
Forks
308
Avg merge
2d 21h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Hamlib/Hamlib

All issues in Hamlib/Hamlib

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.