Skip to content

Commit b578ab8

Browse files
authored
Merge pull request #42 from thomaswucher/patch-1
Update documentation on the MC/DC checker
2 parents 2ced777 + 4b34c7f commit b578ab8

1 file changed

Lines changed: 4 additions & 41 deletions

File tree

source/How-To-Guides/MC-DC-Testing-Tool.rst

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,63 +24,26 @@ Here is an overview of what the MC/DC checker does:
2424
#. Generates BDD .dot files showing before and after reordering.
2525

2626

27-
Patch for the MC/DC checker
28-
---------------------------
29-
30-
Currently the MC/DC checker works for simple C programs but crashes when run against code in several ROS packages. A `patch <https://gist.githubusercontent.com/iche033/ef0d23c85f4d810fa26c722027894c91/raw/f0a9f48abffff0101b9e7f2a2fd94f79cafe360e/mcdc_checker.patch>`_ with minor code changes to checker code is needed to avoid the crash. See instructions below for applying the patch to the checker.
31-
32-
3327
How to run the MC/DC checker
3428
-----------------------------
3529

36-
The recommended way of running the check is to use the upstream docker image as it requires a patched version of ``libclang``.
30+
The recommended way of running the check is to use the upstream docker image as it requires Clang 19 or newer.
3731

38-
39-
Pull their docker image
32+
Pull their docker image:
4033

4134
.. code-block:: bash
4235
4336
docker pull registry.gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker
4437
45-
Launch the docker container and mount your source code that you would like to run MC/DC check on.
38+
Launch the docker container and mount your source code that you would like to run MC/DC check on:
4639

4740
.. code-block:: bash
4841
4942
cd <some_library>
50-
# override entrypoint and run bash:
51-
docker run -it -v $(pwd):/code --entrypoint /bin/bash registry.gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker
52-
53-
54-
In a separate terminal, download the original ``mcdc_checker.py`` script
55-
56-
.. code-block:: bash
57-
58-
wget https://gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker/-/raw/master/src/mcdc_checker.py
59-
60-
Download and apply the patch
61-
62-
.. code-block:: bash
63-
64-
wget https://gist.githubusercontent.com/iche033/ef0d23c85f4d810fa26c722027894c91/raw/f0a9f48abffff0101b9e7f2a2fd94f79cafe360e/mcdc_checker.patch
65-
66-
patch mcdc_checker.py < mcdc_checker.patch
67-
68-
Copy the modified ``mcdc_checker.py`` script into the container
69-
70-
.. code-block:: bash
71-
72-
docker cp mcdc_checker.py `docker ps | grep mcdc-checker | awk '{print $1;}'`:/app/src/mcdc_checker.py
73-
74-
75-
Go back to the docker container and run the ``mcdc_checker`` cmd
76-
77-
.. code-block:: bash
78-
79-
mcdc_checker -a
43+
docker run -it -v $(pwd):/code registry.gitlab.com/gtd-gmbh/mcdc-checker/mcdc-checker -a
8044
8145
The ``-a`` flag tells the check to run recursively on all files in this directory. You should see the script start processing the source code and generating output. See notes below for more info about possible error messages.
8246

83-
8447
Notes about the MC/DC checker
8548
-----------------------------
8649

0 commit comments

Comments
 (0)