diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-26 13:55:07 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-10-26 14:08:25 +0100 |
commit | 79b2fcdc8ae268ca2fe9cc8e65fb12d2d99340ee (patch) | |
tree | 0d2782e2ac3f9496489dae9ed618e9104d99e76a /rtemsspec | |
parent | glossary: Support custom glossary headers (diff) | |
download | rtems-central-79b2fcdc8ae268ca2fe9cc8e65fb12d2d99340ee.tar.bz2 |
glossary: Make project glossary optional
Diffstat (limited to 'rtemsspec')
-rw-r--r-- | rtemsspec/glossary.py | 3 | ||||
-rw-r--r-- | rtemsspec/tests/test_glossary.py | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/rtemsspec/glossary.py b/rtemsspec/glossary.py index 1a7a18cf..c7445874 100644 --- a/rtemsspec/glossary.py +++ b/rtemsspec/glossary.py @@ -106,7 +106,8 @@ def _resolve_glossary_terms(document_terms: ItemMap) -> None: def _generate_project_glossary(glossary: _Glossary, header: str, target: str) -> None: - _generate_glossary_content(glossary.uid_to_item, header, target) + if target: + _generate_glossary_content(glossary.uid_to_item, header, target) def _generate_document_glossary(config: dict, glossary: _Glossary) -> None: diff --git a/rtemsspec/tests/test_glossary.py b/rtemsspec/tests/test_glossary.py index 030e215b..62383f32 100644 --- a/rtemsspec/tests/test_glossary.py +++ b/rtemsspec/tests/test_glossary.py @@ -27,10 +27,19 @@ import os from rtemsspec.glossary import generate -from rtemsspec.items import ItemCache +from rtemsspec.items import EmptyItemCache, ItemCache from rtemsspec.tests.util import create_item_cache_config_and_copy_spec +def test_empty_glossary(): + glossary_config = {} + glossary_config["project-groups"] = [] + glossary_config["project-header"] = None + glossary_config["project-target"] = None + glossary_config["documents"] = [] + generate(glossary_config, EmptyItemCache()) + + def test_glossary(tmpdir): item_cache_config = create_item_cache_config_and_copy_spec( tmpdir, "spec-glossary", with_spec_types=True) |