sanitycheck: raise exceptions on bad test names
Raise exception on bad test names such as 'test' or 'sample'. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
5622ee4c59
commit
7a69125fbf
2 changed files with 7 additions and 1 deletions
|
@ -1336,6 +1336,12 @@ class TestCase(DisablePyTestCollectionMixin):
|
|||
|
||||
# workdir can be "."
|
||||
unique = os.path.normpath(os.path.join(relative_tc_root, workdir, name))
|
||||
check = name.split(".")
|
||||
if len(check) < 2:
|
||||
raise SanityCheckException(f"""bad test name '{name}' in {testcase_root}/{workdir}. \
|
||||
Tests should reference the category and subsystem with a dot as a separator.
|
||||
"""
|
||||
)
|
||||
return unique
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -239,7 +239,7 @@ def export_tests(filename, tests):
|
|||
}
|
||||
cw.writerow(rowdict)
|
||||
else:
|
||||
logger.info("{} can't be exported".format(test))
|
||||
logger.error("{} can't be exported: ".format(test))
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue