3.8 KiB
| title | category | layout | SPDX-License-Identifier |
|---|---|---|---|
| Code Quality Tools | Contributing | default | LGPL-2.1-or-later |
Code Quality Tools
The systemd project has a number of code quality tools set up in the source tree and on the github infrastructure. Here's an incomprehensive list of the available functionality:
-
Use
meson test -C buildto run the unit tests. Some tests are skipped if no privileges are available, hence consider also running them withsudo meson test -C build. A couple of unit tests are considered "unsafe" (as they change system state); to run those too, build withmeson setup -Dtests=unsafe. Finally, some unit tests are considered to be very slow, build them too withmeson setup -Dslow-tests=true. (Note that there are a couple of manual tests in addition to these unit tests.) (Also note: you can change these flags for an already set up build tree, too, with "meson configure -C build -D…".) -
Use
./test/run-integration-tests.shto run the full integration test suite. This will build OS images with a number of integration tests and run them in nspawn and qemu. Requires root. -
Use
./coccinelle/run-coccinelle.shto run all Coccinelle semantic patch scripts we ship. The output will show false positives, hence take it with a pinch of salt. -
Use
./tools/find-double-newline.sh recdiffto find double newlines. Use./tools/find-double-newline.sh recpatchto fix them. Take this with a grain of salt, in particular as we generally leave foreign header files we include in our tree unmodified, if possible. -
Similar use
./tools/find-tabs.sh recdiffto find TABs, and./tools/find-tabs.sh recpatchto fix them. (Again, grain of salt, foreign headers should usually be left unmodified.) -
Use
meson compile -C build check-api-docsto compare the list of exported symbols oflibsystemd.soandlibudev.sowith the list of man pages. Symbols lacking documentation are highlighted. -
Use
meson compile -C build update-hwdbto automatically download and import the PCI, USB and OUI databases into hwdb. -
Use
meson compile -C build update-man-rulesto update the meson rules for building man pages automatically from the docbook XML files included inman/. -
There are multiple CI systems in use that run on every github PR submission.
-
Coverity is analyzing systemd master in regular intervals. The reports are available online.
-
oss-fuzz is continuously fuzzing the codebase. Reports are available online.
-
Our tree includes
.editorconfig,.dir-locals.eland.vimrcfiles, to ensure that editors follow the right indentiation styles automatically. -
When building systemd from a git checkout the build scripts will automatically enable a git commit hook that ensures whitespace cleanliness.
-
LGTM analyzes every commit pushed to master. The list of active alerts can be found here.
-
Each PR is automatically tested with Address Sanitizer and Undefined Behavior Sanitizer. See Testing systemd using sanitizers for more information.
-
Fossies provides source code misspelling reports. The systemd report can be found here.
Access to Coverity and oss-fuzz reports is limited. Please reach out to the maintainers if you need access.