This provides implementation of Silicon Heaven communication protocol in C. This implementation is based on top of threads where there is a dedicated thread that manages the read while all threads can negotiate for write access.
- Meson build system
- gperf
- On non-glibc argp-standalone
For tests:
- check-suite
- bats
- Optionally valgrind
For code coverage report:
For linting:
To compile this project you have to run:
$ meson setup builddir
$ meson compile -C builddir
Subsequent installation can be done with meson install -C builddir
.
The documentation can be built using sphinx-build docs html
.
When you are writing documentation it is handy to use Sphinx-autobuild.
This project contains basic tests in directory tests.
To run tests you have to either use debug
build type (which is commonly the
default for meson) or explicitly enable them using meson configure -Dtests=enabled builddir
. To execute all tests run:
$ meson test -C builddir
You can also run tests with Valgrind tool such as memcheck
:
$ VALGRIND=memcheck meson test -C builddir
There is also possibility to generate code coverage report from test cases. To do so you can run:
$ meson setup -Db_coverage=true builddir
$ meson test -C builddir
$ ninja -C builddir coverage-html
The coverage report is generated in directory:
builddir/meson-logs/coveragereport
.
The code can also be linted if linters are installed. There are two linter
supported at the moment. There is cppcheck
and flawfinder
. To run them you
can do:
$ meson setup builddir
$ meson compile -C builddir cppcheck
$ meson compile -C builddir flawfinder
The build environment, that is all necessary software required to build, lint and test the project can be provided using Nix. To use it you have to install it, please refer to the Nix's documentation for that.
Once you have Nix you can use it to enter development environment. Navigate to
the project's directory and run nix develop
.