|
2 | 2 |
|
3 | 3 | from dataclasses import dataclass
|
4 | 4 | from os import path, walk
|
5 |
| -from posixpath import basename |
6 | 5 | from typing import Iterable
|
7 | 6 |
|
8 | 7 |
|
9 |
| -def get_tests_filenames_from_subdir(tests_dir: str): |
10 |
| - for root, _, files in walk(tests_dir): |
11 |
| - for file in files: |
12 |
| - if file.endswith(".t"): |
13 |
| - yield path.join(basename(root), file) |
| 8 | +def get_tests_filenames_from_spec(tests_list: str): |
| 9 | + with open(tests_list, "r") as file: |
| 10 | + for line in file: |
| 11 | + yield tuple(line.split("\t")) |
14 | 12 |
|
15 | 13 |
|
16 | 14 | def get_rust_files(rust_dir: str):
|
@@ -58,22 +56,22 @@ class Test:
|
58 | 56 |
|
59 | 57 | def main():
|
60 | 58 | rust_dir = "../../rust/src/tests"
|
61 |
| - tests_dir = "../../tests" |
62 |
| - tests_files = set(get_tests_filenames_from_subdir(tests_dir)) |
| 59 | + tests_dir = "../old_testcases.tsv" |
| 60 | + tests_files = set(get_tests_filenames_from_spec(tests_dir)) |
63 | 61 | tests_with_rust_files, _ = (
|
64 |
| - get_tests_with_and_without_rust_files(rust_dir, tests_files) |
| 62 | + get_tests_with_and_without_rust_files(rust_dir, map(lambda v: v[0], tests_files)) |
65 | 63 | )
|
66 | 64 | syscalls: dict[str, list[Test]] = {}
|
67 |
| - for tests_file in tests_files: |
68 |
| - syscall, test_name = tests_file.split("/") |
| 65 | + for testfile, desc in tests_files: |
| 66 | + syscall, test_name = testfile.split("/") |
69 | 67 | if syscall not in syscalls:
|
70 | 68 | syscalls[syscall] = []
|
71 | 69 |
|
72 | 70 | syscalls[syscall].append(
|
73 | 71 | Test(
|
74 | 72 | test_name,
|
75 |
| - tests_file in tests_with_rust_files, |
76 |
| - find_file_description(path.join(tests_dir, tests_file)), |
| 73 | + testfile in tests_with_rust_files, |
| 74 | + desc, |
77 | 75 | )
|
78 | 76 | )
|
79 | 77 |
|
|
0 commit comments