Metadata-Version: 2.4
Name: mcdc-checker
Version: 1.6.0
Summary: A tool to check C/C++ source code for non tree-like binary decisions so that its MCDC test coverage can be assessed with GCov
License-Expression: MPL-2.0
License-File: LICENSE
Keywords: mcdc,coverage,gcov,testing
Author: Celeres GmbH
Maintainer: Thomas Wucher
Maintainer-email: thomas.wucher@celeres.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: C
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing :: Unit
Classifier: Topic :: Utilities
Requires-Dist: clang (>=19.1.7,<20) ; python_version < "3.14"
Requires-Dist: clang (>=21.1.7,<22) ; python_version >= "3.14"
Project-URL: Changelog, https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/blob/master/CHANGELOG.md
Project-URL: Documentation, https://gtd-gmbh.gitlab.io/mcdc-checker/mcdc-checker
Project-URL: Homepage, https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker
Project-URL: Issues, https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/issues
Project-URL: Repository, https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker
Description-Content-Type: text/markdown

# MCDC Checker

This repository contains a tool to check all conditions in your C/C++ source code
if they are in the necessary form, so that Gcov can generate modified condition
decision coverage. This tool requires LLVM/Clang 19 or newer to be installed.

## Quick start

Install the tool with [pipx](https://pipx.pypa.io/), which keeps it in its own
virtual environment, after installing Clang 19 or newer:

```console
pipx install mcdc-checker
mcdc-checker source.c
mcdc-checker -a -j report.json
```

`python -m pip install mcdc-checker` installs it into the active environment
instead, which is what a packager wants. `mcdc-checker -a` checks every source
below the directory, `-j report.json` writes a machine-readable report, and
`mcdc-checker --version` reports the version. `python -m mcdc_checker` runs the
same command from a checkout of the source tree. On Arch Linux, the [`mcdc-checker` AUR
package](https://aur.archlinux.org/packages/mcdc-checker) installs the tool with
an AUR helper.

## Documentation

The full documentation covers installation, usage, the interpretation of the
results, and the theory of operation of the analysis:

- [Published documentation](https://gtd-gmbh.gitlab.io/mcdc-checker/mcdc-checker)
- [Documentation sources](https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/tree/master/doc)

Build it locally with:

```console
poetry install
poetry run sphinx-build -W -b html doc doc_html
```

The generated entry page is `doc_html/index.html`. The `automodule` pages import
the analysis modules, so the build needs the `PBL` and `PBDD` submodules checked
out.

## Development

[CONTRIBUTING.md](https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/blob/master/CONTRIBUTING.md)
describes the development environment, including why the submodules are needed for
every command. The short version:

```console
git submodule update --init --recursive
poetry install
poetry run pytest
PYTHONPATH=PBL/include:PBDD/include poetry run mypy mcdc_checker
poetry run pre-commit run --all-files
```

The pipeline runs the suite on Debian trixie and on Arch Linux, which pin the
interpreters 3.13 and the rolling 3.14 and carry the Clang 19 and 23 that the tool
needs.

## License

The MCDC Checker source code implemented by Celeres is subject to the
[Mozilla Public License 2.0](https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/blob/master/LICENSE)
as indicated by the headers of the corresponding source code files. Third party
libraries used herein are subject to their own licence terms, which is the BSD
license for Clang itself and patches to its source code as well as the PBL and
PBDD libraries.

## Links

- [Documentation](https://gtd-gmbh.gitlab.io/mcdc-checker/mcdc-checker)
- [PyPI](https://pypi.org/project/mcdc-checker/)
- [Source repository](https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker)
- [Issues](https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/issues)
- [Changelog](https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/blob/master/CHANGELOG.md)
- [AUR package](https://aur.archlinux.org/packages/mcdc-checker)

