From b7e749b65fc22afd8eca5498a3931b81429146b8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Aug 2020 07:41:24 +0200 Subject: spec: Add test header to test case item type --- rtemsspec/tests/spec-validation/tc.yml | 1 + rtemsspec/tests/spec-validation/tc2.yml | 1 + rtemsspec/tests/spec-validation/tc3.yml | 1 + rtemsspec/tests/spec-validation/tc4.yml | 1 + spec/req/rtems/barrier/val/ident.yml | 1 + spec/req/rtems/message/val/ident.yml | 1 + spec/req/rtems/part/val/ident.yml | 1 + spec/req/rtems/ratemon/val/ident.yml | 1 + spec/req/rtems/sem/val/ident.yml | 1 + spec/req/rtems/timer/val/ident.yml | 1 + spec/req/rtems/userext/val/ident.yml | 1 + spec/spec/requirement-action-test-header.yml | 48 ---------------------- .../requirement-action-test-run-param-list.yml | 16 -------- spec/spec/requirement-action-test-run-param.yml | 37 ----------------- spec/spec/requirement-action.yml | 2 +- spec/spec/test-case.yml | 3 ++ spec/spec/test-header.yml | 48 ++++++++++++++++++++++ spec/spec/test-run-param-list.yml | 16 ++++++++ spec/spec/test-run-param.yml | 38 +++++++++++++++++ spec/testsuites/validation/c-library.yml | 1 + spec/testsuites/validation/classic-barrier.yml | 1 + 21 files changed, 119 insertions(+), 102 deletions(-) delete mode 100644 spec/spec/requirement-action-test-header.yml delete mode 100644 spec/spec/requirement-action-test-run-param-list.yml delete mode 100644 spec/spec/requirement-action-test-run-param.yml create mode 100644 spec/spec/test-header.yml create mode 100644 spec/spec/test-run-param-list.yml create mode 100644 spec/spec/test-run-param.yml diff --git a/rtemsspec/tests/spec-validation/tc.yml b/rtemsspec/tests/spec-validation/tc.yml index 9b0af09d..682ac541 100644 --- a/rtemsspec/tests/spec-validation/tc.yml +++ b/rtemsspec/tests/spec-validation/tc.yml @@ -50,4 +50,5 @@ prologue: | support: | /* Test case support code */ target: tc12.c +test-header: null type: test-case diff --git a/rtemsspec/tests/spec-validation/tc2.yml b/rtemsspec/tests/spec-validation/tc2.yml index 2af3184c..90be0eed 100644 --- a/rtemsspec/tests/spec-validation/tc2.yml +++ b/rtemsspec/tests/spec-validation/tc2.yml @@ -37,4 +37,5 @@ local-includes: prologue: null support: null target: tc12.c +test-header: null type: test-case diff --git a/rtemsspec/tests/spec-validation/tc3.yml b/rtemsspec/tests/spec-validation/tc3.yml index 8c484761..e16a9329 100644 --- a/rtemsspec/tests/spec-validation/tc3.yml +++ b/rtemsspec/tests/spec-validation/tc3.yml @@ -26,4 +26,5 @@ local-includes: prologue: null support: null target: tc34.c +test-header: null type: test-case diff --git a/rtemsspec/tests/spec-validation/tc4.yml b/rtemsspec/tests/spec-validation/tc4.yml index a1ab1bc5..59ecaf8f 100644 --- a/rtemsspec/tests/spec-validation/tc4.yml +++ b/rtemsspec/tests/spec-validation/tc4.yml @@ -14,4 +14,5 @@ local-includes: [] prologue: null support: null target: tc34.c +test-header: null type: test-case diff --git a/spec/req/rtems/barrier/val/ident.yml b/spec/req/rtems/barrier/val/ident.yml index 62a22eb9..7fc206c3 100644 --- a/spec/req/rtems/barrier/val/ident.yml +++ b/spec/req/rtems/barrier/val/ident.yml @@ -43,4 +43,5 @@ support: | return rtems_barrier_ident( name, id ); } target: testsuites/validation/tc-barrier-ident.c +test-header: null type: test-case diff --git a/spec/req/rtems/message/val/ident.yml b/spec/req/rtems/message/val/ident.yml index d6fc54a7..18565e64 100644 --- a/spec/req/rtems/message/val/ident.yml +++ b/spec/req/rtems/message/val/ident.yml @@ -45,4 +45,5 @@ support: | return rtems_message_queue_ident( name, node, id ); } target: testsuites/validation/tc-message-ident.c +test-header: null type: test-case diff --git a/spec/req/rtems/part/val/ident.yml b/spec/req/rtems/part/val/ident.yml index 28c31859..8120b9f1 100644 --- a/spec/req/rtems/part/val/ident.yml +++ b/spec/req/rtems/part/val/ident.yml @@ -47,4 +47,5 @@ support: | return rtems_partition_ident( name, node, id ); } target: testsuites/validation/tc-part-ident.c +test-header: null type: test-case diff --git a/spec/req/rtems/ratemon/val/ident.yml b/spec/req/rtems/ratemon/val/ident.yml index e8fa2198..9279ceaf 100644 --- a/spec/req/rtems/ratemon/val/ident.yml +++ b/spec/req/rtems/ratemon/val/ident.yml @@ -41,4 +41,5 @@ support: | return rtems_rate_monotonic_ident( name, id ); } target: testsuites/validation/tc-ratemon-ident.c +test-header: null type: test-case diff --git a/spec/req/rtems/sem/val/ident.yml b/spec/req/rtems/sem/val/ident.yml index 7f0ded72..3d231358 100644 --- a/spec/req/rtems/sem/val/ident.yml +++ b/spec/req/rtems/sem/val/ident.yml @@ -45,4 +45,5 @@ support: | return rtems_semaphore_ident( name, node, id ); } target: testsuites/validation/tc-sem-ident.c +test-header: null type: test-case diff --git a/spec/req/rtems/timer/val/ident.yml b/spec/req/rtems/timer/val/ident.yml index 5c8264f9..3d0f479b 100644 --- a/spec/req/rtems/timer/val/ident.yml +++ b/spec/req/rtems/timer/val/ident.yml @@ -41,4 +41,5 @@ support: | return rtems_timer_ident( name, id ); } target: testsuites/validation/tc-timer-ident.c +test-header: null type: test-case diff --git a/spec/req/rtems/userext/val/ident.yml b/spec/req/rtems/userext/val/ident.yml index c125ab2f..6308714b 100644 --- a/spec/req/rtems/userext/val/ident.yml +++ b/spec/req/rtems/userext/val/ident.yml @@ -43,4 +43,5 @@ support: | return rtems_extension_ident( name, id ); } target: testsuites/validation/tc-userext-ident.c +test-header: null type: test-case diff --git a/spec/spec/requirement-action-test-header.yml b/spec/spec/requirement-action-test-header.yml deleted file mode 100644 index 2836e8da..00000000 --- a/spec/spec/requirement-action-test-header.yml +++ /dev/null @@ -1,48 +0,0 @@ -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 -links: -- role: spec-member - uid: root -spec-description: null -spec-example: null -spec-info: - dict: - attributes: - code: - description: | - If the value is present, then it shall be the test case header code. - The header code is placed at file scope after the test enum - declarations and before the test run function declaration. - spec-type: optional-str - includes: - description: | - It shall be a list of header files included by the header file via - ``#include <...>``. - spec-type: list-str - local-includes: - description: | - It shall be a list of header files included by the header file via - ``#include "..."``. - spec-type: list-str - run-params: - description: null - spec-type: requirement-action-test-run-param-list - target: - description: | - It shall be the path to the generated test header file. - spec-type: str - description: | - This set of attributes specifies an action requirement test header. In - case a test header is specified, then instead of a test case a test run - function will be generated. The test run function will be declared in - the test header target file and defined in the test source target file. - The test run function can be used to compose test cases. The test header - file is not automatically included in the test source file. It should be - added to the includes or local includes of the test. - mandatory-attributes: all - none: null -spec-name: Action Requirement Test Header -spec-type: requirement-action-test-header -type: spec diff --git a/spec/spec/requirement-action-test-run-param-list.yml b/spec/spec/requirement-action-test-run-param-list.yml deleted file mode 100644 index 0cf965d7..00000000 --- a/spec/spec/requirement-action-test-run-param-list.yml +++ /dev/null @@ -1,16 +0,0 @@ -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 -links: -- role: spec-member - uid: root -spec-description: null -spec-example: null -spec-info: - list: - description: null - spec-type: requirement-action-test-run-param -spec-name: Action Requirement Test Run Parameter List -spec-type: requirement-action-test-run-param-list -type: spec diff --git a/spec/spec/requirement-action-test-run-param.yml b/spec/spec/requirement-action-test-run-param.yml deleted file mode 100644 index 8d23c11d..00000000 --- a/spec/spec/requirement-action-test-run-param.yml +++ /dev/null @@ -1,37 +0,0 @@ -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 -links: -- role: spec-member - uid: root -spec-description: null -spec-example: null -spec-info: - dict: - attributes: - description: - description: | - It shall be the description of the parameter. - spec-type: str - dir: - description: null - spec-type: interface-param-dir - name: - description: | - It shall be the parameter name. - spec-type: str - specifier: - description: | - It shall be the complete function parameter specifier. Use - ``$${.:name}`` for the parameter name, for example - ``"int $${.:name}"``. - spec-type: str - description: | - This set of attributes specifies a parameter for the test run function. - The parameter is also added as a member to the test context, see - ${requirement-action-test-context:/spec-name}. - mandatory-attributes: all -spec-name: Action Requirement Test Run Parameter -spec-type: requirement-action-test-run-param -type: spec diff --git a/spec/spec/requirement-action.yml b/spec/spec/requirement-action.yml index 1940ad51..e588a73b 100644 --- a/spec/spec/requirement-action.yml +++ b/spec/spec/requirement-action.yml @@ -173,7 +173,7 @@ spec-info: spec-type: optional-str test-header: description: null - spec-type: requirement-action-test-header + spec-type: test-header test-includes: description: | It shall be a list of header files included via ``#include <...>``. diff --git a/spec/spec/test-case.yml b/spec/spec/test-case.yml index 03260915..b8862ae8 100644 --- a/spec/spec/test-case.yml +++ b/spec/spec/test-case.yml @@ -37,6 +37,9 @@ spec-info: fixture. The test case fixture pointer declaration may be provided by the test case support code or via an included header file. spec-type: optional-str + test-header: + description: null + spec-type: test-header includes: description: | It shall be a list of header files included via ``#include <...>``. diff --git a/spec/spec/test-header.yml b/spec/spec/test-header.yml new file mode 100644 index 00000000..a15fc5dc --- /dev/null +++ b/spec/spec/test-header.yml @@ -0,0 +1,48 @@ +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 +links: +- role: spec-member + uid: root +spec-description: null +spec-example: null +spec-info: + dict: + attributes: + code: + description: | + If the value is present, then it shall be the test header code. The + header code is placed at file scope after the general test + declarations and before the test run function declaration. + spec-type: optional-str + includes: + description: | + It shall be a list of header files included by the header file via + ``#include <...>``. + spec-type: list-str + local-includes: + description: | + It shall be a list of header files included by the header file via + ``#include "..."``. + spec-type: list-str + run-params: + description: null + spec-type: test-run-param-list + target: + description: | + It shall be the path to the generated test header file. + spec-type: str + description: | + This set of attributes specifies a test header. In case a test header is + specified, then instead of a test case a test run function will be + generated. The test run function will be declared in the test header + target file and defined in the test source target file. The test run + function can be used to compose test cases. The test header file is not + automatically included in the test source file. It should be added to + the includes or local includes of the test. + mandatory-attributes: all + none: null +spec-name: Test Header +spec-type: test-header +type: spec diff --git a/spec/spec/test-run-param-list.yml b/spec/spec/test-run-param-list.yml new file mode 100644 index 00000000..af481ac9 --- /dev/null +++ b/spec/spec/test-run-param-list.yml @@ -0,0 +1,16 @@ +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 +links: +- role: spec-member + uid: root +spec-description: null +spec-example: null +spec-info: + list: + description: null + spec-type: test-run-param +spec-name: Test Run Parameter List +spec-type: test-run-param-list +type: spec diff --git a/spec/spec/test-run-param.yml b/spec/spec/test-run-param.yml new file mode 100644 index 00000000..77c0d3c6 --- /dev/null +++ b/spec/spec/test-run-param.yml @@ -0,0 +1,38 @@ +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 +links: +- role: spec-member + uid: root +spec-description: null +spec-example: null +spec-info: + dict: + attributes: + description: + description: | + It shall be the description of the parameter. + spec-type: str + dir: + description: null + spec-type: interface-param-dir + name: + description: | + It shall be the parameter name. + spec-type: str + specifier: + description: | + It shall be the complete function parameter specifier. Use + ``$${.:name}`` for the parameter name, for example + ``"int $${.:name}"``. + spec-type: str + description: | + This set of attributes specifies a parameter for the test run function. + In case this parameter is used in an ${requirement-action:/spec-name} + item, then the parameter is also added as a member to the test context, + see ${requirement-action-test-context:/spec-name}. + mandatory-attributes: all +spec-name: Test Run Parameter +spec-type: test-run-param +type: spec diff --git a/spec/testsuites/validation/c-library.yml b/spec/testsuites/validation/c-library.yml index 24312218..dda4d364 100644 --- a/spec/testsuites/validation/c-library.yml +++ b/spec/testsuites/validation/c-library.yml @@ -74,4 +74,5 @@ prologue: | int d; support: null target: testsuites/validation/tc-space-profile.c +test-header: null type: test-case diff --git a/spec/testsuites/validation/classic-barrier.yml b/spec/testsuites/validation/classic-barrier.yml index f4e5e44e..d72b49ae 100644 --- a/spec/testsuites/validation/classic-barrier.yml +++ b/spec/testsuites/validation/classic-barrier.yml @@ -82,4 +82,5 @@ prologue: | uint32_t released; support: null target: testsuites/validation/tc-space-profile.c +test-header: null type: test-case -- cgit v1.2.3