|
|
|
@ -134,11 +134,11 @@ class InstalledFile: |
|
|
|
|
self.path = raw['file'] |
|
|
|
|
self.typ = raw['type'] |
|
|
|
|
self.platform = raw.get('platform', None) |
|
|
|
|
self.language = raw.get('language', 'c') # type: str |
|
|
|
|
self.language = raw.get('language', 'c') |
|
|
|
|
|
|
|
|
|
version = raw.get('version', '') # type: str |
|
|
|
|
version = raw.get('version', '') |
|
|
|
|
if version: |
|
|
|
|
self.version = version.split('.') # type: T.List[str] |
|
|
|
|
self.version = version.split('.') |
|
|
|
|
else: |
|
|
|
|
# split on '' will return [''], we want an empty list though |
|
|
|
|
self.version = [] |
|
|
|
@ -280,9 +280,9 @@ class TestDef: |
|
|
|
|
self.args = args |
|
|
|
|
self.skip = skip |
|
|
|
|
self.env = os.environ.copy() |
|
|
|
|
self.installed_files = [] # type: T.List[InstalledFile] |
|
|
|
|
self.do_not_set_opts = [] # type: T.List[str] |
|
|
|
|
self.stdout = [] # type: T.List[T.Dict[str, str]] |
|
|
|
|
self.installed_files: T.List[InstalledFile] = [] |
|
|
|
|
self.do_not_set_opts: T.List[str] = [] |
|
|
|
|
self.stdout: T.List[T.Dict[str, str]] = [] |
|
|
|
|
self.skip_category = skip_category |
|
|
|
|
self.skip_expected = False |
|
|
|
|
|
|
|
|
@ -399,7 +399,7 @@ def platform_fix_name(fname: str, canonical_compiler: str, env: environment.Envi |
|
|
|
|
|
|
|
|
|
def validate_install(test: TestDef, installdir: Path, env: environment.Environment) -> str: |
|
|
|
|
ret_msg = '' |
|
|
|
|
expected_raw = [] # type: T.List[Path] |
|
|
|
|
expected_raw: T.List[Path] = [] |
|
|
|
|
for i in test.installed_files: |
|
|
|
|
try: |
|
|
|
|
expected_raw += i.get_paths(host_c_compiler, env, installdir) |
|
|
|
@ -828,7 +828,7 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal |
|
|
|
|
test_def = json.loads(test_def_file.read_text(encoding='utf-8')) |
|
|
|
|
|
|
|
|
|
# Handle additional environment variables |
|
|
|
|
env = {} # type: T.Dict[str, str] |
|
|
|
|
env: T.Dict[str, str] = {} |
|
|
|
|
if 'env' in test_def: |
|
|
|
|
assert isinstance(test_def['env'], dict) |
|
|
|
|
env = test_def['env'] |
|
|
|
@ -838,7 +838,7 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal |
|
|
|
|
env[key] = val |
|
|
|
|
|
|
|
|
|
# Handle installed files |
|
|
|
|
installed = [] # type: T.List[InstalledFile] |
|
|
|
|
installed: T.List[InstalledFile] = [] |
|
|
|
|
if 'installed' in test_def: |
|
|
|
|
installed = [InstalledFile(x) for x in test_def['installed']] |
|
|
|
|
|
|
|
|
@ -848,7 +848,7 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal |
|
|
|
|
raise RuntimeError(f"{test_def_file} must contain a non-empty stdout key") |
|
|
|
|
|
|
|
|
|
# Handle the do_not_set_opts list |
|
|
|
|
do_not_set_opts = test_def.get('do_not_set_opts', []) # type: T.List[str] |
|
|
|
|
do_not_set_opts: T.List[str] = test_def.get('do_not_set_opts', []) |
|
|
|
|
|
|
|
|
|
(t.skip, t.skip_expected) = _skip_keys(test_def) |
|
|
|
|
|
|
|
|
@ -872,12 +872,12 @@ def load_test_json(t: TestDef, stdout_mandatory: bool, skip_category: bool = Fal |
|
|
|
|
new_opt_list: T.List[T.List[T.Tuple[str, str, bool, bool]]] |
|
|
|
|
|
|
|
|
|
# 'matrix; entry is present, so build multiple tests from matrix definition |
|
|
|
|
opt_list = [] # type: T.List[T.List[T.Tuple[str, str, bool, bool]]] |
|
|
|
|
opt_list: T.List[T.List[T.Tuple[str, str, bool, bool]]] = [] |
|
|
|
|
matrix = test_def['matrix'] |
|
|
|
|
assert "options" in matrix |
|
|
|
|
for key, val in matrix["options"].items(): |
|
|
|
|
assert isinstance(val, list) |
|
|
|
|
tmp_opts = [] # type: T.List[T.Tuple[str, str, bool, bool]] |
|
|
|
|
tmp_opts: T.List[T.Tuple[str, str, bool, bool]] = [] |
|
|
|
|
for i in val: |
|
|
|
|
assert isinstance(i, dict) |
|
|
|
|
assert "val" in i |
|
|
|
|