Skip to content

Commit 22ce16d

Browse files
simheinnashif
authored andcommitted
doc: sca: Add Bugseng eclair documentation
Add the documentation for the eclair from Bugseng with the pre configuration for the zephyr project. Signed-off-by: Simon Hein <[email protected]>
1 parent e0db9ce commit 22ce16d

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed

doc/develop/sca/eclair.rst

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
.. _eclair:
2+
3+
ECLAIR support
4+
##############
5+
6+
Bugseng `ECLAIR <https://www.bugseng.com/eclair/>`__ is a certified
7+
static analysis tool and platform for software verification.
8+
Applications range from coding rule validation, with a
9+
particular emphasis on the MISRA and BARR-C coding standards, to the
10+
computation of software metrics, to the checking of independence and
11+
freedom from interference among software components, to the automatic
12+
detection of important classes of software errors.
13+
14+
.. important::
15+
16+
ECLAIR is a commercial tool, and it is not free software.
17+
You need to have a valid license to use it.
18+
19+
Running ECLAIR
20+
**************
21+
22+
To run ECLAIR, :ref:`west build <west-building>` should be
23+
called with a ``-DZEPHYR_SCA_VARIANT=eclair`` parameter.
24+
25+
.. code-block:: shell
26+
27+
west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=eclair
28+
29+
.. note::
30+
This will only invoke the ECLAIR analysis with the predefined ruleset ``first_analysis``. If you
31+
want to use a different ruleset, you need to provide a configuration file. See the next section
32+
for more information.
33+
34+
Configurations
35+
**************
36+
37+
The configure of the ECLAIR SCA environment can either be done via a cmake options file or with
38+
adapted options as command line arguments.
39+
40+
To invoke a cmake options file into the ECLAIR call, you can define the ``ECLAIR_OPTIONS_FILE``
41+
variable, for example:
42+
43+
.. code-block:: shell
44+
45+
west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=eclair -DECLAIR_OPTIONS_FILE=my_options.cmake
46+
47+
The default (if no config file is given) configuration is always ``first_analysis``,
48+
which is a tiny selection of rules to verify that everything is correctly working.
49+
50+
If the default configuration wants to be overwritten via the command line and not via a options
51+
file, that can be achived by giving the argument ``-DOption=ON|OFF``.
52+
53+
For example:
54+
55+
.. code-block:: shell
56+
57+
west build -b mimxrt1064_evk samples/basic/blinky -- -DZEPHYR_SCA_VARIANT=eclair -DECLAIR_REPORTS_SARIF=ON
58+
59+
Zephyr is a large and complex project, so the configuration sets are split the
60+
Zephyr's guidelines selection
61+
(taken from https://docs.zephyrproject.org/latest/contribute/coding_guidelines/index.html)
62+
in five sets to make it more digestible to use on a private machine:
63+
64+
* first_analysis (default): a tiny selection of the projects coding guidelines to verify that
65+
everything is correctly working.
66+
67+
* STU: Selection of the projects coding guidelines, which can be verified by analysing the single
68+
translation units independently.
69+
70+
* STU_heavy: Selection of complex STU project coding guidelines that require a significant amount
71+
of time.
72+
73+
* WP: All whole program project coding guidelines ("system" in MISRA's parlance).
74+
75+
* std_lib: Project coding guidelines about the C Standard Library.
76+
77+
Related cmake options:
78+
79+
* ``ECLAIR_RULESET_FIRST_ANALYSIS``
80+
* ``ECLAIR_RULESET_STU``
81+
* ``ECLAIR_RULESET_STU_HEAVY``
82+
* ``ECLAIR_RULESET_WP``
83+
* ``ECLAIR_RULESET_STD_LIB``
84+
85+
User defined ruleset
86+
====================
87+
88+
If you want to use your own defined ruleset instead of the predefined zephyr coding guidelines
89+
rulesets. You can do so by setting :code:`ECLAIR_RULESET_USER=ON`.
90+
Created your own rulset file for ECLAIR with the following naming format:
91+
``analysis_<RULESET>.ecl``. After creating the file define the name of the ruleset for ECLAIR
92+
with the cmake variable :code:`ECLAIR_USER_RULESET_NAME`.
93+
If the ruleset file is not in the application source directory, you can define the path to the
94+
ruleset file with the cmake variable :code:`ECLAIR_USER_RULESET_PATH`. This configuration takes
95+
relative paths and absolute paths.
96+
97+
Related cmake options and variables:
98+
99+
* ``ECLAIR_RULESET_USER``
100+
* ``ECLAIR_USER_RULESET_NAME``
101+
* ``ECLAIR_USER_RULESET_PATH``
102+
103+
Generate additional report formats
104+
**********************************
105+
106+
ECLAIR can generate additional report formats (e.g. DOC, ODT, XLSX) and
107+
different variants of repots in addition to the
108+
default ecd file. Following additional reports and report formats can be generated:
109+
110+
* Metrics in spreadsheet format.
111+
112+
* Findings in spreadsheet format.
113+
114+
* Findings in SARIF format.
115+
116+
* Summary report in plain textual format.
117+
118+
* Summary report in DOC format.
119+
120+
* Summary report in ODT format.
121+
122+
* Detailed reports in txt format.
123+
124+
* Detailed report in DOC format.
125+
126+
* Detailed report in ODT format.
127+
128+
Related cmake options:
129+
130+
* ``ECLAIR_METRICS_TAB``
131+
* ``ECLAIR_REPORTS_TAB``
132+
* ``ECLAIR_REPORTS_SARIF``
133+
* ``ECLAIR_SUMMARY_TXT``
134+
* ``ECLAIR_SUMMARY_DOC``
135+
* ``ECLAIR_SUMMARY_ODT``
136+
* ``ECLAIR_FULL_TXT``
137+
* ``ECLAIR_FULL_DOC``
138+
* ``ECLAIR_FULL_ODT``
139+
140+
Detail level of full reports
141+
============================
142+
143+
The detail level of the txt and doc full reports can also be adapted by a configuration.
144+
In this case the following configurations are avilable:
145+
146+
* Show all areas
147+
148+
* Show only the first area
149+
150+
Related cmake options:
151+
152+
* ``ECLAIR_FULL_DOC_ALL_AREAS``
153+
* ``ECLAIR_FULL_DOC_FIRST_AREA``
154+
* ``ECLAIR_FULL_TXT_ALL_AREAS``
155+
* ``ECLAIR_FULL_TXT_FIRST_AREA``

doc/develop/sca/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,4 @@ The following is a list of SCA tools natively supported by Zephyr build system.
6565
sparse
6666
gcc
6767
cpptest
68+
eclair

0 commit comments

Comments
 (0)