File: HACKING.md

package info (click to toggle)
bolt 0.7-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,396 kB
  • sloc: ansic: 21,784; python: 1,574; xml: 426; sh: 25; makefile: 13
file content (70 lines) | stat: -rw-r--r-- 1,923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Patches
=======

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


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

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.

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

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

Static analysis
===============

The clang static analyzer can be run locally via:

    ninja -C <buildir> scan-build

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:

	CC=gcc CXX=gcc meson -Dcoverity=true coverity
	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.

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