Skip to content

codehippo/shvc

Repository files navigation

Silicon Heaven in C

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.

Dependencies

For tests:

For code coverage report:

For linting:

Compilation

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.

Documentation

The documentation can be built using sphinx-build docs html.

When you are writing documentation it is handy to use Sphinx-autobuild.

Running tests

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

Code coverage report

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.

Linting the code

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

Using Nix development environment

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published