summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-02 16:48:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-09-02 16:49:30 +0200
commit67a358cd526614e0620f8a2f9aa3f7ccb61c4a57 (patch)
tree2d7f792c28d8383a2f64c7fb93d4f25cd56370cc
parentmodules: Update rtems (diff)
downloadrtems-central-67a358cd526614e0620f8a2f9aa3f7ccb61c4a57.tar.bz2
validation: Fix empty test context
-rw-r--r--rtemsspec/validation.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/rtemsspec/validation.py b/rtemsspec/validation.py
index 88625784..741a0604 100644
--- a/rtemsspec/validation.py
+++ b/rtemsspec/validation.py
@@ -335,22 +335,26 @@ class _TestItem:
def add_context(self, content: CContent) -> str:
""" Adds the context to the content. """
content.add(self.substitute_code(self["test-context-support"]))
- if not self["test-context"] and (
- not self["test-header"]
- or not self["test-header"]["run-params"]):
+ default_members = CContent()
+ with default_members.indent():
+ self.add_default_context_members(default_members)
+ if not self["test-context"] and not default_members.lines:
return "NULL"
with content.doxygen_block():
content.add_brief_description(
f"Test context for {self.name} test case.")
content.append("typedef struct {")
+ gap = False
with content.indent():
for info in self["test-context"]:
content.add_description_block(
self.substitute_text(info["brief"]),
self.substitute_text(info["description"]))
content.add(f"{info['member'].strip()};")
- self.add_default_context_members(content)
- content.add([
+ gap = content.gap
+ content.gap = gap
+ content.add(default_members)
+ content.append([
f"}} {self.context};", "", f"static {self.context}",
f" {self.ident}_Instance;"
])