File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -37,4 +37,5 @@ $(WORK_DIR)/test_list.yaml: $(DB_DIR)/test_list.yaml
3737$(DB_DIR ) /test_list.yaml : mlogv32/mlogv32_isa.yaml mlogv32/mlogv32_platform.yaml $(CONFIG )
3838 rm -rf $(DB_DIR )
3939 riscof testlist $(ARGS )
40+ python filter_test_list.py --work-dir $(WORK_DIR ) --config $(CONFIG )
4041 mv $(WORK_DIR ) $(DB_DIR )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ ispec=./mlogv32/mlogv32_isa.yaml
1010pspec =./mlogv32/mlogv32_platform.yaml
1111target_run =1
1212jobs =8
13+ skip_tests =/vm_sv32/
1314# change these when running the tests on another computer (FIXME: hack)
1415host_repo_path =/Users/object/Git/mlogv32
1516riscof_repo_path =/workspaces/mlogv32
Original file line number Diff line number Diff line change 1+ from configparser import ConfigParser
2+ from pathlib import Path
3+ from typing import Any
4+
5+ import yaml
6+ from typer import Typer
7+
8+ app = Typer ()
9+
10+
11+ @app .command ()
12+ def main (
13+ work_dir : Path = Path ("riscof_work" ),
14+ config : Path = Path ("config.ini" ),
15+ ):
16+ with open (config , "r" ) as f :
17+ cfg = ConfigParser ()
18+ cfg .read_file (f )
19+ skip_tests = cfg .get ("mlogv32" , "skip_tests" ).split ("," )
20+
21+ with open (work_dir / "test_list.yaml" , "rb" ) as f :
22+ test_list : dict [str , Any ] = yaml .load (f , yaml .Loader )
23+
24+ filtered_list = dict [str , Any ]()
25+ for testname , value in test_list .items ():
26+ for skip in skip_tests :
27+ if skip in testname :
28+ break
29+ else :
30+ filtered_list [testname ] = value
31+ continue
32+ _ , _ , test_display_name = testname .partition (
33+ "riscv-arch-test/riscv-test-suite/"
34+ )
35+ print (f"Skipping test: { test_display_name } " )
36+
37+ with open (work_dir / "test_list.yaml" , "w" ) as f :
38+ yaml .dump (filtered_list , f )
39+
40+
41+ if __name__ == "__main__" :
42+ app ()
You can’t perform that action at this time.
0 commit comments