66
77TEST_MODELS_DIR = os .path .join (os .path .dirname (__file__ ), ".." , "test_models" )
88
9+ # Files that are misplaced in test_models/ but actually test invalid syntax
10+ # (dotinfeaturename.uvl has comment "should be illegal" - dots not allowed in quoted IDs)
11+ MISPLACED_INVALID_FILES = {
12+ "lexing/dotinfeaturename.uvl" ,
13+ }
14+
915# Semantic errors that the parser cannot detect (only syntax errors are caught)
1016SEMANTIC_ERROR_FILES = {
1117 "missingreference.uvl" ,
1420}
1521
1622
23+ def relative_path (file ):
24+ return os .path .relpath (file , TEST_MODELS_DIR )
25+
26+
1727def get_valid_files ():
1828 all_files = glob .glob (os .path .join (TEST_MODELS_DIR , "**" , "*.uvl" ), recursive = True )
19- return [f for f in all_files if os .sep + "faulty" + os .sep not in f ]
29+ valid = [f for f in all_files if os .sep + "faulty" + os .sep not in f ]
30+ return [f for f in valid if relative_path (f ) not in MISPLACED_INVALID_FILES ]
2031
2132
2233def get_faulty_syntax_files ():
@@ -25,10 +36,6 @@ def get_faulty_syntax_files():
2536 return [f for f in all_faulty if os .path .basename (f ) not in SEMANTIC_ERROR_FILES ]
2637
2738
28- def relative_path (file ):
29- return os .path .relpath (file , TEST_MODELS_DIR )
30-
31-
3239@pytest .mark .parametrize ("uvl_file" , get_valid_files (), ids = relative_path )
3340def test_valid_model (uvl_file ):
3441 tree = get_tree (uvl_file )
0 commit comments