summaryrefslogtreecommitdiffstats
path: root/rtemsspec
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-26 13:55:07 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-26 14:08:25 +0100
commit79b2fcdc8ae268ca2fe9cc8e65fb12d2d99340ee (patch)
tree0d2782e2ac3f9496489dae9ed618e9104d99e76a /rtemsspec
parentglossary: Support custom glossary headers (diff)
downloadrtems-central-79b2fcdc8ae268ca2fe9cc8e65fb12d2d99340ee.tar.bz2
glossary: Make project glossary optional
Diffstat (limited to 'rtemsspec')
-rw-r--r--rtemsspec/glossary.py3
-rw-r--r--rtemsspec/tests/test_glossary.py11
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)