summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-05-26 08:33:00 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-05-28 10:38:23 +0200
commitfa461cb4ad365fe049ef52a8ee00414a30b15e8d (patch)
tree8f4d0e2578826b3d6caf7f53fad84f21c56244b2
parentitems: Add EmptyItemCache (diff)
downloadrtems-central-fa461cb4ad365fe049ef52a8ee00414a30b15e8d.tar.bz2
Rename test case attributes
-rw-r--r--rtemsqual/tests/spec-validation/tc.yml18
-rw-r--r--rtemsqual/tests/spec-validation/tc2.yml18
-rw-r--r--rtemsqual/tests/spec-validation/tc3.yml18
-rw-r--r--rtemsqual/tests/spec-validation/tc4.yml18
-rw-r--r--rtemsqual/tests/spec-validation/ts.yml2
-rw-r--r--rtemsqual/validation.py28
-rw-r--r--spec/testsuites/validation/c-library.yml36
-rw-r--r--spec/testsuites/validation/classic-barrier.yml32
-rw-r--r--spec/testsuites/validation/profile.yml2
9 files changed, 85 insertions, 87 deletions
diff --git a/rtemsqual/tests/spec-validation/tc.yml b/rtemsqual/tests/spec-validation/tc.yml
index fc537a52..bb63ea74 100644
--- a/rtemsqual/tests/spec-validation/tc.yml
+++ b/rtemsqual/tests/spec-validation/tc.yml
@@ -7,8 +7,8 @@ includes:
links: []
local-includes:
- x.h
-source: tc12.c
-test-case-actions:
+target: tc12.c
+actions:
- action: |
/* Test case action 0 code */
checks:
@@ -41,14 +41,14 @@ test-case-actions:
description: |
Test case action 1 description.
links: []
-test-case-brief: Test case brief description.
-test-case-description: Test case description.
-test-case-epilogue: |
+brief: Test case brief description.
+description: Test case description.
+epilogue: |
/* Test case epilogue code */
-test-case-fixture: null
-test-case-name: Test Case
-test-case-prologue: |
+fixture: null
+name: Test Case
+prologue: |
/* Test case prologue code */
-test-case-support: |
+support: |
/* Test case support code */
type: test-case
diff --git a/rtemsqual/tests/spec-validation/tc2.yml b/rtemsqual/tests/spec-validation/tc2.yml
index ae4656aa..df236b99 100644
--- a/rtemsqual/tests/spec-validation/tc2.yml
+++ b/rtemsqual/tests/spec-validation/tc2.yml
@@ -7,8 +7,8 @@ includes:
links: []
local-includes:
- y.h
-source: tc12.c
-test-case-actions:
+target: tc12.c
+actions:
- action: |
/* Test case 2 action 0 code */
checks:
@@ -31,11 +31,11 @@ test-case-actions:
description: |
Test case 2 action 1 description.
links: []
-test-case-brief: Test case 2 brief description.
-test-case-description: Test case 2 description.
-test-case-epilogue: null
-test-case-fixture: test_case_2_fixture
-test-case-name: Test Case 2
-test-case-prologue: null
-test-case-support: null
+brief: Test case 2 brief description.
+description: Test case 2 description.
+epilogue: null
+fixture: test_case_2_fixture
+name: Test Case 2
+prologue: null
+support: null
type: test-case
diff --git a/rtemsqual/tests/spec-validation/tc3.yml b/rtemsqual/tests/spec-validation/tc3.yml
index da79ad0e..fd946e3e 100644
--- a/rtemsqual/tests/spec-validation/tc3.yml
+++ b/rtemsqual/tests/spec-validation/tc3.yml
@@ -7,8 +7,8 @@ includes:
links: []
local-includes:
- z.h
-source: tc34.c
-test-case-actions:
+target: tc34.c
+actions:
- action: |
/* Test case 3 action 0 code */
checks:
@@ -20,11 +20,11 @@ test-case-actions:
description: |
Test case 3 action 0 description.
links: []
-test-case-brief: Test case 3 brief description.
-test-case-description: Test case 3 description.
-test-case-epilogue: null
-test-case-fixture: null
-test-case-name: Test Case 3
-test-case-prologue: null
-test-case-support: null
+brief: Test case 3 brief description.
+description: Test case 3 description.
+epilogue: null
+fixture: null
+name: Test Case 3
+prologue: null
+support: null
type: test-case
diff --git a/rtemsqual/tests/spec-validation/tc4.yml b/rtemsqual/tests/spec-validation/tc4.yml
index b9375b56..d415ff79 100644
--- a/rtemsqual/tests/spec-validation/tc4.yml
+++ b/rtemsqual/tests/spec-validation/tc4.yml
@@ -5,14 +5,14 @@ enabled-by: true
includes: []
links: []
local-includes: []
-source: tc34.c
-test-case-actions: []
-test-case-brief: Test case 4 brief description.
-test-case-description: Test case 4 description.
-test-case-epilogue: |
+target: tc34.c
+actions: []
+brief: Test case 4 brief description.
+description: Test case 4 description.
+epilogue: |
/* Test case 4 epilogue code */
-test-case-fixture: null
-test-case-name: Test Case 4
-test-case-prologue: null
-test-case-support: null
+fixture: null
+name: Test Case 4
+prologue: null
+support: null
type: test-case
diff --git a/rtemsqual/tests/spec-validation/ts.yml b/rtemsqual/tests/spec-validation/ts.yml
index 0fbff40b..428c456a 100644
--- a/rtemsqual/tests/spec-validation/ts.yml
+++ b/rtemsqual/tests/spec-validation/ts.yml
@@ -7,7 +7,7 @@ includes:
links: []
local-includes:
- green.h
-source: ts.c
+target: ts.c
test-suite-code: |
/* Blue green code */
test-suite-description: The Blue Green description.
diff --git a/rtemsqual/validation.py b/rtemsqual/validation.py
index 9f0cca6e..094443c8 100644
--- a/rtemsqual/validation.py
+++ b/rtemsqual/validation.py
@@ -79,7 +79,7 @@ def _add_test_case_description(content: CContent, item: Item,
def _add_test_case_action_description(content: CContent, item: Item) -> None:
- actions = item["test-case-actions"]
+ actions = item["actions"]
if actions:
content.add("This test case performs the following actions:")
for action in actions:
@@ -92,7 +92,7 @@ def _add_test_case_action_description(content: CContent, item: Item) -> None:
def _generate_test_case_actions(item: Item, steps: StepWrapper) -> CContent:
content = CContent()
- for action in item["test-case-actions"]:
+ for action in item["actions"]:
content.add(action["action"])
for check in action["checks"]:
content.append(string.Template(check["check"]).substitute(steps))
@@ -101,15 +101,15 @@ def _generate_test_case_actions(item: Item, steps: StepWrapper) -> CContent:
def _generate_test_case(content: CContent, item: Item,
test_case_to_suites: Dict[str, List[Item]]) -> None:
- name = item["test-case-name"]
+ name = item["name"]
desi = _designator(name)
_add_test_case_description(content, item, test_case_to_suites, desi, name)
- content.add(item["test-case-support"])
+ content.add(item["support"])
with content.function_block(f"void T_case_body_{desi}(void)"):
- content.add_brief_description(item["test-case-brief"])
- content.wrap(item["test-case-description"])
+ content.add_brief_description(item["brief"])
+ content.wrap(item["description"])
_add_test_case_action_description(content, item)
- fixture = item["test-case-fixture"]
+ fixture = item["fixture"]
if fixture:
content.append(f"T_TEST_CASE_FIXTURE({desi}, &{fixture})")
else:
@@ -117,13 +117,13 @@ def _generate_test_case(content: CContent, item: Item,
content.append("{")
content.gap = False
with content.indent():
- content.add(item["test-case-prologue"])
+ content.add(item["prologue"])
steps = StepWrapper()
action_content = _generate_test_case_actions(item, steps)
if steps.steps > 0:
content.add(f"T_plan({steps.steps});")
content.add(action_content)
- content.add(item["test-case-epilogue"])
+ content.add(item["epilogue"])
content.add(["}", "", "/** @} */"])
@@ -181,15 +181,13 @@ class SourceFile:
with content.file_block():
_add_ingroup(content, self._test_suites, "RTEMSTestSuite",
"test-suite-name")
- _add_ingroup(content, self._test_cases, "RTEMSTestCase",
- "test-case-name")
+ _add_ingroup(content, self._test_cases, "RTEMSTestCase", "name")
content.add_copyrights_and_licenses()
content.add_have_config()
content.add_includes(includes)
content.add_includes(local_includes, local=True)
content.add_includes([CInclude("t.h")])
- for item in sorted(self._test_cases,
- key=lambda x: x["test-case-name"]):
+ for item in sorted(self._test_cases, key=lambda x: x["name"]):
_generate_test_case(content, item, test_case_to_suites)
for item in sorted(self._test_suites,
key=lambda x: x["test-suite-name"]):
@@ -230,10 +228,10 @@ def _gather_items(item: Item, source_files: Dict[str, SourceFile],
for child in item.children():
_gather_items(child, source_files, test_programs)
if item["type"] == "test-suite":
- src = _get_source_file(item["source"], source_files)
+ src = _get_source_file(item["target"], source_files)
src.add_test_suite(item)
elif item["type"] == "test-case":
- src = _get_source_file(item["source"], source_files)
+ src = _get_source_file(item["target"], source_files)
src.add_test_case(item)
elif item["type"] == "build" and item["build-type"] == "test-program":
test_programs.append(TestProgram(item))
diff --git a/spec/testsuites/validation/c-library.yml b/spec/testsuites/validation/c-library.yml
index a4f43bfe..704541eb 100644
--- a/spec/testsuites/validation/c-library.yml
+++ b/spec/testsuites/validation/c-library.yml
@@ -1,15 +1,5 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-copyrights:
-- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
-enabled-by: true
-includes:
-- rtems.h
-- stdlib.h
-- rtems/malloc.h
-links: []
-local-includes: []
-source: testsuites/validation/tc-space-profile.c
-test-case-actions:
+actions:
- action: |
p = aligned_alloc(128, 4);
checks:
@@ -63,16 +53,26 @@ test-case-actions:
Set a source integer variable to one, set a destination integer variable to
two, and copy the source to the destination variable through memcpy().
links: []
-test-case-brief: |
+brief: |
This test case calls functions of the C Library which are included in the
space profile.
-test-case-description: null
-test-case-epilogue: null
-test-case-fixture: null
-test-case-name: Space Profile C Library
-test-case-prologue: |
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+description: null
+enabled-by: true
+epilogue: null
+fixture: null
+includes:
+- rtems.h
+- stdlib.h
+- rtems/malloc.h
+links: []
+local-includes: []
+name: Space Profile C Library
+prologue: |
void *p;
int s;
int d;
-test-case-support: null
+support: null
+target: testsuites/validation/tc-space-profile.c
type: test-case
diff --git a/spec/testsuites/validation/classic-barrier.yml b/spec/testsuites/validation/classic-barrier.yml
index aa83ad14..477cddeb 100644
--- a/spec/testsuites/validation/classic-barrier.yml
+++ b/spec/testsuites/validation/classic-barrier.yml
@@ -1,13 +1,5 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
-copyrights:
-- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
-enabled-by: true
-includes:
-- rtems.h
-links: []
-local-includes: []
-source: testsuites/validation/tc-space-profile.c
-test-case-actions:
+actions:
- action: |
id = 0xffffffff;
sc = rtems_barrier_create(name, RTEMS_BARRIER_AUTOMATIC_RELEASE, 1, &id);
@@ -68,19 +60,27 @@ test-case-actions:
description: |
Wait with an infinite timeout for the barrier.
links: []
-test-case-brief: |
+brief: |
This test case calls functions of the Barrier Manager which are included in
the space profile.
-test-case-description: null
-test-case-epilogue: |
+copyrights:
+- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+description: null
+enabled-by: true
+epilogue: |
T_check_rtems_barriers(T_EVENT_RUN_INITIALIZE_EARLY, T_case_name());
-test-case-fixture: null
-test-case-name: Space Profile Classic Barriers
-test-case-prologue: |
+fixture: null
+includes:
+- rtems.h
+links: []
+local-includes: []
+name: Space Profile Classic Barriers
+prologue: |
static const rtems_name name = rtems_build_name('B', 'A', 'R', 'R');
rtems_status_code sc;
rtems_id id;
rtems_id id2;
uint32_t released;
-test-case-support: null
+support: null
+target: testsuites/validation/tc-space-profile.c
type: test-case
diff --git a/spec/testsuites/validation/profile.yml b/spec/testsuites/validation/profile.yml
index 72e61813..be64c9b2 100644
--- a/spec/testsuites/validation/profile.yml
+++ b/spec/testsuites/validation/profile.yml
@@ -9,7 +9,7 @@ includes:
- rtems/score/sysstate.h
links: []
local-includes: []
-source: testsuites/validation/ts-space-profile.c
+target: testsuites/validation/ts-space-profile.c
test-suite-brief: |
This test suite contains test cases which call in combination all functions
included in the space profile.