twister: remove some leftover sanitycheck mentions
Few leftover mentions of Sanitycheck. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
86c872dbc5
commit
4594370b46
7 changed files with 35 additions and 35 deletions
|
@ -1,7 +1,7 @@
|
|||
#! /usr/bin/python
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Zephyr's Sanity Check library
|
||||
# Zephyr's Twister library
|
||||
#
|
||||
# pylint: disable=unused-import
|
||||
#
|
||||
|
|
|
@ -340,24 +340,24 @@ class CMakeCache:
|
|||
return iter(self._entries.values())
|
||||
|
||||
|
||||
class SanityCheckException(Exception):
|
||||
class TwisterException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SanityRuntimeError(SanityCheckException):
|
||||
class TwisterRuntimeError(TwisterException):
|
||||
pass
|
||||
|
||||
|
||||
class ConfigurationError(SanityCheckException):
|
||||
class ConfigurationError(TwisterException):
|
||||
def __init__(self, cfile, message):
|
||||
SanityCheckException.__init__(self, cfile + ": " + message)
|
||||
TwisterException.__init__(self, cfile + ": " + message)
|
||||
|
||||
|
||||
class BuildError(SanityCheckException):
|
||||
class BuildError(TwisterException):
|
||||
pass
|
||||
|
||||
|
||||
class ExecutionError(SanityCheckException):
|
||||
class ExecutionError(TwisterException):
|
||||
pass
|
||||
|
||||
|
||||
|
@ -1219,7 +1219,7 @@ class SizeCalculator:
|
|||
|
||||
try:
|
||||
if magic != b'\x7fELF':
|
||||
raise SanityRuntimeError("%s is not an ELF binary" % filename)
|
||||
raise TwisterRuntimeError("%s is not an ELF binary" % filename)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
sys.exit(2)
|
||||
|
@ -1234,7 +1234,7 @@ class SizeCalculator:
|
|||
"utf-8").strip()
|
||||
try:
|
||||
if is_xip_output.endswith("no symbols"):
|
||||
raise SanityRuntimeError("%s has no symbol information" % filename)
|
||||
raise TwisterRuntimeError("%s has no symbol information" % filename)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
sys.exit(2)
|
||||
|
@ -1330,12 +1330,12 @@ class SizeCalculator:
|
|||
|
||||
|
||||
|
||||
class SanityConfigParser:
|
||||
class TwisterConfigParser:
|
||||
"""Class to read test case files with semantic checking
|
||||
"""
|
||||
|
||||
def __init__(self, filename, schema):
|
||||
"""Instantiate a new SanityConfigParser object
|
||||
"""Instantiate a new TwisterConfigParser object
|
||||
|
||||
@param filename Source .yaml file to read
|
||||
"""
|
||||
|
@ -1496,7 +1496,7 @@ class Platform:
|
|||
self.filter_data = dict()
|
||||
|
||||
def load(self, platform_file):
|
||||
scp = SanityConfigParser(platform_file, self.platform_schema)
|
||||
scp = TwisterConfigParser(platform_file, self.platform_schema)
|
||||
scp.load()
|
||||
data = scp.data
|
||||
|
||||
|
@ -1605,7 +1605,7 @@ class TestCase(DisablePyTestCollectionMixin):
|
|||
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}. \
|
||||
raise TwisterException(f"""bad test name '{name}' in {testcase_root}/{workdir}. \
|
||||
Tests should reference the category and subsystem with a dot as a separator.
|
||||
"""
|
||||
)
|
||||
|
@ -1683,7 +1683,7 @@ Tests should reference the category and subsystem with a dot as a separator.
|
|||
_subcases, warnings = self.scan_file(filename)
|
||||
if warnings:
|
||||
logger.error("%s: %s" % (filename, warnings))
|
||||
raise SanityRuntimeError("%s: %s" % (filename, warnings))
|
||||
raise TwisterRuntimeError("%s: %s" % (filename, warnings))
|
||||
if _subcases:
|
||||
subcases += _subcases
|
||||
except ValueError as e:
|
||||
|
@ -2812,7 +2812,7 @@ class TestSuite(DisablePyTestCollectionMixin):
|
|||
|
||||
try:
|
||||
if not toolchain:
|
||||
raise SanityRuntimeError("E: Variable ZEPHYR_TOOLCHAIN_VARIANT is not defined")
|
||||
raise TwisterRuntimeError("E: Variable ZEPHYR_TOOLCHAIN_VARIANT is not defined")
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
sys.exit(2)
|
||||
|
@ -2839,7 +2839,7 @@ class TestSuite(DisablePyTestCollectionMixin):
|
|||
tc_path = os.path.join(dirpath, filename)
|
||||
|
||||
try:
|
||||
parsed_data = SanityConfigParser(tc_path, self.tc_schema)
|
||||
parsed_data = TwisterConfigParser(tc_path, self.tc_schema)
|
||||
parsed_data.load()
|
||||
|
||||
tc_path = os.path.dirname(tc_path)
|
||||
|
@ -3239,7 +3239,7 @@ class TestSuite(DisablePyTestCollectionMixin):
|
|||
|
||||
try:
|
||||
if not self.discards:
|
||||
raise SanityRuntimeError("apply_filters() hasn't been run!")
|
||||
raise TwisterRuntimeError("apply_filters() hasn't been run!")
|
||||
except Exception as e:
|
||||
logger.error(str(e))
|
||||
sys.exit(2)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
# Sanitycheck Testing
|
||||
# Twister Testing
|
||||
|
||||
Running the tests require the environment variable ZEPHYR_BASE to be set.
|
||||
|
||||
Sanitycheck Testsuite are located in $ZEPHYR_BASE/scripts/tests directory with all the data files in $ZEPHYR_BASE/scripts/test_data directory.
|
||||
Twister Testsuite are located in $ZEPHYR_BASE/scripts/tests directory with all the data files in $ZEPHYR_BASE/scripts/test_data directory.
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
@ -20,7 +20,7 @@ The testcases can be executed from the root directory using
|
|||
pytest $ZEPHYR_BASE/scripts/tests/twister
|
||||
```
|
||||
|
||||
## Sanitycheck Coverage
|
||||
## Twister Coverage
|
||||
|
||||
The coverage for all the tests can be run using the command below. This will collect all the tests available.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import pytest
|
|||
|
||||
ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
|
||||
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
|
||||
from twisterlib import TestInstance, BuildError, TestCase, SanityCheckException
|
||||
from twisterlib import TestInstance, BuildError, TestCase, TwisterException
|
||||
|
||||
|
||||
TESTDATA_1 = [
|
||||
|
@ -108,7 +108,7 @@ TESTDATA_4 = [
|
|||
def test_get_unique_exception(testcase_root, workdir, name, exception):
|
||||
'''Test to check if tests reference the category and subsystem with a dot as a separator'''
|
||||
|
||||
with pytest.raises(SanityCheckException):
|
||||
with pytest.raises(TwisterException):
|
||||
unique = TestCase(testcase_root, workdir, name)
|
||||
assert unique == exception
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ def test_testsuite_add_testcases(class_testsuite):
|
|||
|
||||
@pytest.mark.parametrize("board_root_dir", [("board_config_file_not_exist"), ("board_config")])
|
||||
def test_add_configurations(test_data, class_testsuite, board_root_dir):
|
||||
""" Testing add_configurations function of TestSuite class in Sanitycheck
|
||||
""" Testing add_configurations function of TestSuite class in Twister
|
||||
Test : Asserting on default platforms list
|
||||
"""
|
||||
class_testsuite.board_roots = os.path.abspath(test_data + board_root_dir)
|
||||
|
@ -56,7 +56,7 @@ def test_add_configurations(test_data, class_testsuite, board_root_dir):
|
|||
assert sorted(suite.default_platforms) != sorted(['demo_board_1'])
|
||||
|
||||
def test_get_all_testcases(class_testsuite, all_testcases_dict):
|
||||
""" Testing get_all_testcases function of TestSuite class in Sanitycheck """
|
||||
""" Testing get_all_testcases function of TestSuite class in Twister """
|
||||
class_testsuite.testcases = all_testcases_dict
|
||||
expected_tests = ['sample_test.app', 'test_a.check_1.1a', 'test_a.check_1.1c',
|
||||
'test_a.check_1.2a', 'test_a.check_1.2b', 'test_a.check_1.Unit_1c', 'test_a.check_1.unit_1a', 'test_a.check_1.unit_1b', 'test_a.check_2.1a', 'test_a.check_2.1c', 'test_a.check_2.2a', 'test_a.check_2.2b', 'test_a.check_2.Unit_1c', 'test_a.check_2.unit_1a', 'test_a.check_2.unit_1b', 'test_b.check_1', 'test_b.check_2', 'test_c.check_1', 'test_c.check_2']
|
||||
|
@ -64,7 +64,7 @@ def test_get_all_testcases(class_testsuite, all_testcases_dict):
|
|||
assert sorted(class_testsuite.get_all_tests()) == sorted(expected_tests)
|
||||
|
||||
def test_get_toolchain(class_testsuite, monkeypatch, capsys):
|
||||
""" Testing get_toolchain function of TestSuite class in Sanitycheck
|
||||
""" Testing get_toolchain function of TestSuite class in Twister
|
||||
Test 1 : Test toolchain returned by get_toolchain function is same as in the environment.
|
||||
Test 2 : Monkeypatch to delete the ZEPHYR_TOOLCHAIN_VARIANT env var
|
||||
and check if appropriate error is raised"""
|
||||
|
@ -79,7 +79,7 @@ def test_get_toolchain(class_testsuite, monkeypatch, capsys):
|
|||
assert out == "E: Variable ZEPHYR_TOOLCHAIN_VARIANT is not defined\n"
|
||||
|
||||
def test_get_platforms(class_testsuite, platforms_list):
|
||||
""" Testing get_platforms function of TestSuite class in Sanitycheck """
|
||||
""" Testing get_platforms function of TestSuite class in Twister """
|
||||
class_testsuite.platforms = platforms_list
|
||||
platform = class_testsuite.get_platform("demo_board_1")
|
||||
assert isinstance(platform, Platform)
|
||||
|
@ -87,7 +87,7 @@ def test_get_platforms(class_testsuite, platforms_list):
|
|||
|
||||
def test_load_from_file(test_data, class_testsuite,
|
||||
platforms_list, all_testcases_dict, caplog, tmpdir_factory):
|
||||
""" Testing load_from_file function of TestSuite class in Sanitycheck """
|
||||
""" Testing load_from_file function of TestSuite class in Twister """
|
||||
# Scenario 1 : Validating the error raised if file to load from doesn't exist
|
||||
with pytest.raises(SystemExit):
|
||||
class_testsuite.load_from_file(test_data +"twister_test.csv")
|
||||
|
@ -160,7 +160,7 @@ TESTDATA_PART1 = [
|
|||
TESTDATA_PART1)
|
||||
def test_apply_filters_part1(class_testsuite, all_testcases_dict, platforms_list,
|
||||
tc_attribute, tc_value, plat_attribute, plat_value, expected_discards):
|
||||
""" Testing apply_filters function of TestSuite class in Sanitycheck
|
||||
""" Testing apply_filters function of TestSuite class in Twister
|
||||
Part 1: Response of apply_filters function (discard dictionary) have
|
||||
appropriate values according to the filters
|
||||
"""
|
||||
|
@ -233,7 +233,7 @@ TESTDATA_PART2 = [
|
|||
@pytest.mark.parametrize("extra_filter, extra_filter_value, expected_discards", TESTDATA_PART2)
|
||||
def test_apply_filters_part2(class_testsuite, all_testcases_dict,
|
||||
platforms_list, extra_filter, extra_filter_value, expected_discards):
|
||||
""" Testing apply_filters function of TestSuite class in Sanitycheck
|
||||
""" Testing apply_filters function of TestSuite class in Twister
|
||||
Part 2 : Response of apply_filters function (discard dictionary) have
|
||||
appropriate values according to the filters
|
||||
"""
|
||||
|
@ -265,7 +265,7 @@ TESTDATA_PART3 = [
|
|||
TESTDATA_PART3)
|
||||
def test_apply_filters_part3(class_testsuite, all_testcases_dict, platforms_list,
|
||||
tc_min_flash, plat_flash, tc_min_ram, plat_ram):
|
||||
""" Testing apply_filters function of TestSuite class in Sanitycheck
|
||||
""" Testing apply_filters function of TestSuite class in Twister
|
||||
Part 3 : Testing edge cases for ram and flash values of platforms & testcases
|
||||
"""
|
||||
class_testsuite.platforms = platforms_list
|
||||
|
@ -282,7 +282,7 @@ def test_apply_filters_part3(class_testsuite, all_testcases_dict, platforms_list
|
|||
assert not discards
|
||||
|
||||
def test_add_instances(test_data, class_testsuite, all_testcases_dict, platforms_list):
|
||||
""" Testing add_instances() function of TestSuite class in Sanitycheck
|
||||
""" Testing add_instances() function of TestSuite class in Twister
|
||||
Test 1: instances dictionary keys have expected values (Platform Name + Testcase Name)
|
||||
Test 2: Values of 'instances' dictionary in Testsuite class are an
|
||||
instance of 'TestInstance' class
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
"""
|
||||
This test file contains foundational testcases for Sanitycheck tool
|
||||
This test file contains foundational testcases for Twister tool
|
||||
"""
|
||||
|
||||
import os
|
||||
|
@ -14,7 +14,7 @@ ZEPHYR_BASE = os.getenv("ZEPHYR_BASE")
|
|||
sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister"))
|
||||
|
||||
import scl
|
||||
from twisterlib import SanityConfigParser
|
||||
from twisterlib import TwisterConfigParser
|
||||
|
||||
def test_yamlload():
|
||||
""" Test to check if loading the non-existent files raises the errors """
|
||||
|
@ -30,7 +30,7 @@ def test_correct_schema(filename, schema, test_data):
|
|||
""" Test to validate the testcase schema"""
|
||||
filename = test_data + filename
|
||||
schema = scl.yaml_load(ZEPHYR_BASE +'/scripts/schemas/twister//' + schema)
|
||||
data = SanityConfigParser(filename, schema)
|
||||
data = TwisterConfigParser(filename, schema)
|
||||
data.load()
|
||||
assert data
|
||||
|
||||
|
|
|
@ -612,7 +612,7 @@ structure in the main Zephyr tree: boards/<arch>/<board_name>/""")
|
|||
|
||||
serial.add_argument("--device-serial-pty",
|
||||
help="""Script for controlling pseudoterminal.
|
||||
Sanitycheck believes that it interacts with a terminal
|
||||
Twister believes that it interacts with a terminal
|
||||
when it actually interacts with the script.
|
||||
|
||||
E.g "twister --device-testing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue