1 | # RTEMS Specification Items and Qualification Tools |
---|
2 | |
---|
3 | This repository contains a prototype of the RTEMS specification and tools to |
---|
4 | generate content from the specification. It demonstrates the use of Python |
---|
5 | development tools such as yapf, flake8, mypy, pylint, pytest, and coverage. |
---|
6 | |
---|
7 | ## Repository Overview |
---|
8 | |
---|
9 | * env - contains the Python environment (created by `make env`) |
---|
10 | |
---|
11 | * spec - contains the specification items |
---|
12 | |
---|
13 | * rtemsspec - contains the `rtemsspec` Python package |
---|
14 | |
---|
15 | * tests - contains Python unit tests |
---|
16 | |
---|
17 | * modules - contains Git submodules |
---|
18 | |
---|
19 | * rsb - contains the RTEMS Source Builder as a Git submodule |
---|
20 | |
---|
21 | * rtems - contains the RTEMS sources as a Git submodule |
---|
22 | |
---|
23 | * rtems-docs - contains the RTEMS documentation sources as a Git submodule |
---|
24 | |
---|
25 | * `rtems_spec_to_x.py` - a command line tool to generate content from the |
---|
26 | specification |
---|
27 | |
---|
28 | ## Getting Started |
---|
29 | |
---|
30 | Copy the sanity check script at least to the pre-push hook (optional also to |
---|
31 | the pre-commit hook): |
---|
32 | ``` |
---|
33 | cp git-hooks/sanity-check.sh .git/hooks/pre-push |
---|
34 | ``` |
---|
35 | Run |
---|
36 | ``` |
---|
37 | git submodule init |
---|
38 | git submodule update |
---|
39 | ``` |
---|
40 | to initialize the Git submodules. Run |
---|
41 | ``` |
---|
42 | make env |
---|
43 | ``` |
---|
44 | to set up the Python environment. Activate the Python environment afterwards |
---|
45 | with |
---|
46 | ``` |
---|
47 | . env/bin/activate |
---|
48 | ``` |
---|
49 | If submodule URLs changed after a pull use |
---|
50 | ``` |
---|
51 | git submodule sync |
---|
52 | ``` |
---|
53 | to activate the new URLs. |
---|
54 | |
---|
55 | ## Specification Items |
---|
56 | |
---|
57 | The |
---|
58 | [specification items](https://docs.rtems.org/branches/master/eng/req-eng.html#specification-items) |
---|
59 | are located in the `spec` directory. You can use a text editor to work with |
---|
60 | them. |
---|
61 | |
---|
62 | ## Specification-To-X Tool |
---|
63 | |
---|
64 | The command line tool `rtems_spec_to_x.py` generates content from the |
---|
65 | specification. The tool is configured by the `config.ini` configuration file. |
---|
66 | This is a prototype implementation. It demonstrates the generation of a |
---|
67 | project-wide glossary (`external/rtems-docs/c-user/glossary.rst`) and |
---|
68 | document-specific glossaries (`external/rtems-docs/eng/glossary.rst`) from |
---|
69 | glossary specification items (glossary groups and terms in `spec/glos`). |
---|
70 | |
---|
71 | Example: |
---|
72 | ``` |
---|
73 | $ ./rtems_spec_to_x.py |
---|
74 | $ git status |
---|
75 | On branch master |
---|
76 | Your branch is up to date with 'origin/master'. |
---|
77 | |
---|
78 | nothing to commit, working tree clean |
---|
79 | $ sed -i 's/Binary/Boom/' spec/glos/term/abi.yml |
---|
80 | $ ./rtems_spec_to_x.py |
---|
81 | $ git status |
---|
82 | On branch master |
---|
83 | Your branch is up to date with 'origin/master'. |
---|
84 | |
---|
85 | Changes not staged for commit: |
---|
86 | (use "git add <file>..." to update what will be committed) |
---|
87 | (use "git checkout -- <file>..." to discard changes in working directory) |
---|
88 | (commit or discard the untracked or modified content in submodules) |
---|
89 | |
---|
90 | modified: external/rtems-docs (modified content) |
---|
91 | modified: spec/glos/term/RTEMS-GLOS-TERM-ABI.yml |
---|
92 | |
---|
93 | no changes added to commit (use "git add" and/or "git commit -a") |
---|
94 | $ cd external/rtems-docs |
---|
95 | $ git diff |
---|
96 | diff --git a/c-user/glossary.rst b/c-user/glossary.rst |
---|
97 | index d0996e8..dfac60c 100644 |
---|
98 | --- a/c-user/glossary.rst |
---|
99 | +++ b/c-user/glossary.rst |
---|
100 | @@ -10,7 +10,7 @@ Glossary |
---|
101 | :sorted: |
---|
102 | |
---|
103 | ABI |
---|
104 | - An acronym for Application Binary Interface. |
---|
105 | + An acronym for Application Boom Interface. |
---|
106 | |
---|
107 | active |
---|
108 | A term used to describe an object which has been created by an |
---|
109 | diff --git a/eng/glossary.rst b/eng/glossary.rst |
---|
110 | index c58e67f..ac2c8f8 100644 |
---|
111 | --- a/eng/glossary.rst |
---|
112 | +++ b/eng/glossary.rst |
---|
113 | @@ -9,7 +9,7 @@ Glossary |
---|
114 | :sorted: |
---|
115 | |
---|
116 | ABI |
---|
117 | - An acronym for Application Binary Interface. |
---|
118 | + An acronym for Application Boom Interface. |
---|
119 | |
---|
120 | API |
---|
121 | An acronym for Application Programming Interface. |
---|
122 | ``` |
---|
123 | |
---|
124 | ## Unit Tests and Static Analysers |
---|
125 | |
---|
126 | Run the unit tests and static analysers with: |
---|
127 | ``` |
---|
128 | make |
---|
129 | ``` |
---|
130 | You can get a branch coverage report with: |
---|
131 | ``` |
---|
132 | $ make coverage-report |
---|
133 | coverage report -m --include=... |
---|
134 | Name Stmts Miss Branch BrPart Cover Missing |
---|
135 | --------------------------------------------------------------------- |
---|
136 | rtemsspec/__init__.py 8 0 0 0 100% |
---|
137 | rtemsspec/applconfig.py 130 0 53 0 100% |
---|
138 | rtemsspec/build.py 36 0 14 0 100% |
---|
139 | rtemsspec/content.py 133 0 44 0 100% |
---|
140 | rtemsspec/glossary.py 70 0 31 0 100% |
---|
141 | rtemsspec/items.py 139 0 46 0 100% |
---|
142 | rtemsspec/util.py 26 0 2 0 100% |
---|
143 | --------------------------------------------------------------------- |
---|
144 | TOTAL 542 0 190 0 100% |
---|
145 | ``` |
---|
146 | |
---|
147 | ## Contributing |
---|
148 | |
---|
149 | Please read |
---|
150 | [Support and Contributing](https://docs.rtems.org/branches/master/user/support/index.html). |
---|
151 | |
---|
152 | For the ESA activity do not push to the `esa` branch directly. Instead always |
---|
153 | work on topic branches and use merge requests, for example: |
---|
154 | ``` |
---|
155 | git push -o merge_request.create topic-branch |
---|
156 | ``` |
---|
157 | |
---|
158 | ## License |
---|
159 | |
---|
160 | This project is licensed under the |
---|
161 | [BSD-2-Clause](https://spdx.org/licenses/BSD-2-Clause.html) or |
---|
162 | [CC-BY-SA-4.0](https://spdx.org/licenses/CC-BY-SA-4.0.html). |
---|