HACKING.md 1.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
Patches
=======

Patches should be submitted in the form of pull requests at
[github][github].


Coding style
============

11 12 13 14
The style is codified via the supplied `sscripts/uncrustify.cfg` config.
It can be automatically formatted by the `uncrustify` target, i.e. by
invoking `ninja -C <builddir> uncrustify`.
Make sure to format the source code before submitting pull requests.
15

16 17 18 19 20 21 22 23 24 25 26 27 28
Testing
=======

To run the test suite in verbose mode:

	meson test -C build --verbose

To run `boltd` from within valgrind for the integration tests set the
environment variable `VALGRIND`. A [suppression file][valgrind] can be
specified via that variable as well (n.b. for meson the path must be
relative to the build directory):

	VALGRIND=../bolt.supp meson test -C build --verbose
29

30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
Coverage
--------

To analyze the current code coverage either `lcov` or `gcovr` need
to be installed. Support must also be enabled during configure time:

	meson -Db_coverage=true <buildir>

This should enable the general `coverage` target as well as the
`coverage-{text, html, xml}` targets:

	ninja -C <builddir> coverage

To manually invoke `gcovr` and exclude the `cli` directory use:

	gcovr -r <builddir> -e cli -s

47 48 49 50 51 52 53
Static analysis
===============

The clang static analyzer can be run locally via:

    ninja -C <buildir> scan-build

54 55 56 57 58 59 60
Coverity
--------

Bolt is registerd with [coverity][coverity]. To submit a local build,
execute the following commands (the `cov-build` [build tool][cov-build]
must be in `PATH`) from the source directory:

61
	CC=gcc CXX=gcc meson -Dcoverity=true coverity
62 63 64 65
	cov-build --dir cov-int ninja -C coverity
	tar caf bolt.xz cov-int

Upload the `bolt.xz` file to coverity for analysis. Fix defects. Profit.
66 67

[github]: https://github.com/gicmo/bolt
68 69
[coverity]: https://scan.coverity.com/projects/bolt
[cov-build]: https://scan.coverity.com/download
70
[valgrind]: https://gist.github.com/gicmo/327dad149fcb386ac7f59e279b8ba322