sanitycheck: add testcases for add_testcases function of testsuite class
test_testsuite_class.py: Add testcases for add_testcases function
of testsuite class in sanitycheck.
test_data/testcases/tests & /samples : Testcase root directory
to add all the testcases & to test add_testcases function.
conftest.py: Module for common pytest fixtures, also used for
passing data from one testcase to another.
Note: conftest.py has a class_testsuite fixture where board_root is
defined as the directory which will be added in a separate PR.
Signed-off-by: Aastha Grover <aastha.grover@intel.com>
diff --git a/scripts/tests/sanitycheck/conftest.py b/scripts/tests/sanitycheck/conftest.py
new file mode 100644
index 0000000..96db650
--- /dev/null
+++ b/scripts/tests/sanitycheck/conftest.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+# Copyright (c) 2020 Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.0
+# pylint: disable=redefined-outer-name
+# pylint: disable=line-too-long
+'''Common fixtures for use in testing the sanitycheck tool.'''
+
+import os
+import sys
+import pytest
+
+ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
+sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/sanity_chk"))
+from sanitylib import TestSuite
+
+@pytest.fixture(name='test_data')
+def _test_data():
+ """ Pytest fixture to load the test data directory"""
+ data = ZEPHYR_BASE + "/scripts/tests/sanitycheck/test_data/"
+ return data
+
+@pytest.fixture
+def testcases_dir():
+ """ Pytest fixture to load the test data directory"""
+ return ZEPHYR_BASE + "/scripts/tests/sanitycheck/test_data/testcases"
+
+@pytest.fixture
+def class_testsuite(test_data, testcases_dir):
+ """ Pytest fixture to initialize and return the class TestSuite object"""
+ board_root = test_data +"board_config/1_level/2_level/"
+ testcase_root = [testcases_dir + '/tests', testcases_dir + '/samples']
+ outdir = test_data +'sanity_out_demo'
+ suite = TestSuite(board_root, testcase_root, outdir)
+ return suite