|
|
|
@ -1645,11 +1645,11 @@ ALL_TEST_OBJECTS = [ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_all_tests() -> List[Test]: |
|
|
|
|
installed_solcs = set(get_installed_solc_versions()) |
|
|
|
|
required_solcs = {test.solc_ver for test in ALL_TEST_OBJECTS} |
|
|
|
|
missing_solcs = list(required_solcs - installed_solcs) |
|
|
|
|
if missing_solcs: |
|
|
|
|
install_solc_versions(missing_solcs) |
|
|
|
|
# installed_solcs = set(get_installed_solc_versions()) |
|
|
|
|
# required_solcs = {test.solc_ver for test in ALL_TEST_OBJECTS} |
|
|
|
|
# missing_solcs = list(required_solcs - installed_solcs) |
|
|
|
|
# if missing_solcs: |
|
|
|
|
# install_solc_versions(missing_solcs) |
|
|
|
|
|
|
|
|
|
return ALL_TEST_OBJECTS |
|
|
|
|
|
|
|
|
@ -1671,9 +1671,8 @@ def test_detector(test_item: Test): |
|
|
|
|
test_item.solc_ver, |
|
|
|
|
) |
|
|
|
|
test_file_path = pathlib.Path(test_dir_path, test_item.test_file).as_posix() |
|
|
|
|
expected_result_path = ( |
|
|
|
|
pathlib.Path(test_dir_path, test_item.expected_result).absolute().as_posix() |
|
|
|
|
) |
|
|
|
|
expected_result_path = pathlib.Path(test_dir_path, test_item.expected_result).absolute().as_posix() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cc = load_from_zip(f"{test_file_path}-{test_item.solc_ver}.zip")[0] |
|
|
|
|
sl = Slither(cc) |
|
|
|
@ -1686,7 +1685,7 @@ def test_detector(test_item: Test): |
|
|
|
|
results_as_string = json.dumps(results) |
|
|
|
|
|
|
|
|
|
for additional_file in test_item.additional_files: |
|
|
|
|
additional_path = str(pathlib.Path(test_dir_path, additional_file).absolute()) |
|
|
|
|
additional_path = pathlib.Path(test_dir_path, additional_file).absolute().as_posix() |
|
|
|
|
additional_path = additional_path.replace("\\", "\\\\") |
|
|
|
|
results_as_string = results_as_string.replace(additional_path, GENERIC_PATH) |
|
|
|
|
test_file_path = test_file_path.replace("\\", "\\\\") |
|
|
|
|