sanitylib: Remove hardcoded sample.yaml & testcase.yaml in TestSuite class
This fix creates class variables SAMPLE_FILENAME & TESTCASE_FILENAME
in Class TestSuite and remove the hardcoded sample.yaml & testcase.yaml
from add_testcases function. This makes testing for sanitylib script
easier so that shippable do not detect the test_data for sanitylib
as actual zephyr testcases.
Signed-off-by: Aastha Grover <aastha.grover@intel.com>
diff --git a/scripts/sanity_chk/sanitylib.py b/scripts/sanity_chk/sanitylib.py
index fc4d07a..de71132 100644
--- a/scripts/sanity_chk/sanitylib.py
+++ b/scripts/sanity_chk/sanitylib.py
@@ -2216,6 +2216,9 @@
RELEASE_DATA = os.path.join(ZEPHYR_BASE, "scripts", "sanity_chk",
"sanity_last_release.csv")
+ SAMPLE_FILENAME = 'sample.yaml'
+ TESTCASE_FILENAME = 'testcase.yaml'
+
def __init__(self, board_root_list=[], testcase_roots=[], outdir=None):
self.roots = testcase_roots
@@ -2488,10 +2491,10 @@
for dirpath, dirnames, filenames in os.walk(root, topdown=True):
logger.debug("scanning %s" % dirpath)
- if 'sample.yaml' in filenames:
- filename = 'sample.yaml'
- elif 'testcase.yaml' in filenames:
- filename = 'testcase.yaml'
+ if self.SAMPLE_FILENAME in filenames:
+ filename = self.SAMPLE_FILENAME
+ elif self.TESTCASE_FILENAME in filenames:
+ filename = self.TESTCASE_FILENAME
else:
continue