Add toggle for test case count in descriptions
Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
parent
34d6d3e4e5
commit
858cffde1e
1 changed files with 11 additions and 6 deletions
|
@ -43,6 +43,7 @@ class BaseTarget(metaclass=ABCMeta):
|
||||||
case_description: Short description of the test case. This may be
|
case_description: Short description of the test case. This may be
|
||||||
automatically generated using the class, or manually set.
|
automatically generated using the class, or manually set.
|
||||||
dependencies: A list of dependencies required for the test case.
|
dependencies: A list of dependencies required for the test case.
|
||||||
|
show_test_count: Toggle for inclusion of `count` in the test description.
|
||||||
target_basename: Basename of file to write generated tests to. This
|
target_basename: Basename of file to write generated tests to. This
|
||||||
should be specified in a child class of BaseTarget.
|
should be specified in a child class of BaseTarget.
|
||||||
test_function: Test function which the class generates cases for.
|
test_function: Test function which the class generates cases for.
|
||||||
|
@ -53,6 +54,7 @@ class BaseTarget(metaclass=ABCMeta):
|
||||||
count = 0
|
count = 0
|
||||||
case_description = ""
|
case_description = ""
|
||||||
dependencies = [] # type: List[str]
|
dependencies = [] # type: List[str]
|
||||||
|
show_test_count = True
|
||||||
target_basename = ""
|
target_basename = ""
|
||||||
test_function = ""
|
test_function = ""
|
||||||
test_name = ""
|
test_name = ""
|
||||||
|
@ -78,16 +80,19 @@ class BaseTarget(metaclass=ABCMeta):
|
||||||
"""Create a test case description.
|
"""Create a test case description.
|
||||||
|
|
||||||
Creates a description of the test case, including a name for the test
|
Creates a description of the test case, including a name for the test
|
||||||
function, a case number, and a description the specific test case.
|
function, an optional case count, and a description of the specific
|
||||||
This should inform a reader what is being tested, and provide context
|
test case. This should inform a reader what is being tested, and
|
||||||
for the test case.
|
provide context for the test case.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Description for the test case.
|
Description for the test case.
|
||||||
"""
|
"""
|
||||||
return "{} #{} {}".format(
|
if self.show_test_count:
|
||||||
self.test_name, self.count, self.case_description
|
return "{} #{} {}".format(
|
||||||
).strip()
|
self.test_name, self.count, self.case_description
|
||||||
|
).strip()
|
||||||
|
else:
|
||||||
|
return "{} {}".format(self.test_name, self.case_description).strip()
|
||||||
|
|
||||||
|
|
||||||
def create_test_case(self) -> test_case.TestCase:
|
def create_test_case(self) -> test_case.TestCase:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue