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:
Anas Nashif 2020-05-07 07:47:51 -04:00
commit 7a69125fbf
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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():