6
6
7
7
@parameterized_class ([
8
8
{ "src" : "rdl_testcases/preprocessor.rdl" },
9
- # { "src": "rdl_testcases/preprocessor_CRLF.rdl"},
9
+ { "src" : "rdl_testcases/preprocessor_CRLF.rdl" },
10
10
])
11
11
class TestPreprocessor (RDLSourceTestCase ):
12
12
@@ -44,21 +44,21 @@ def test_src_ref_translation(self):
44
44
with self .subTest ("top def" ):
45
45
src_ref = root .find_by_path ("top" ).inst .def_src_ref
46
46
47
- self .assertEqual (os .path .basename (src_ref .path ), "preprocessor.rdl" )
47
+ self .assertEqual (os .path .basename (src_ref .path ), os . path . basename ( self . src ) )
48
48
self .assertEqual (src_ref .line , 25 )
49
49
self .assertEqual (src_ref .line_selection , (18 , 18 ))
50
50
51
51
with self .subTest ("reg1 def" ):
52
52
src_ref = root .find_by_path ("top.reg1" ).inst .def_src_ref
53
53
54
- self .assertEqual (os .path .basename (src_ref .path ), "preprocessor.rdl" )
54
+ self .assertEqual (os .path .basename (src_ref .path ), os . path . basename ( self . src ) )
55
55
self .assertEqual (src_ref .line , 11 )
56
56
self .assertEqual (src_ref .line_selection , (10 , 10 ))
57
57
58
58
with self .subTest ("reg1 inst" ):
59
59
src_ref = root .find_by_path ("top.reg1" ).inst .inst_src_ref
60
60
61
- self .assertEqual (os .path .basename (src_ref .path ), "preprocessor.rdl" )
61
+ self .assertEqual (os .path .basename (src_ref .path ), os . path . basename ( self . src ) )
62
62
self .assertEqual (src_ref .line , 26 )
63
63
self .assertEqual (src_ref .line_selection , (10 , 13 ))
64
64
@@ -72,7 +72,7 @@ def test_src_ref_translation(self):
72
72
with self .subTest ("data0 inst" ):
73
73
src_ref = root .find_by_path ("top.reg1.data0" ).inst .inst_src_ref
74
74
75
- self .assertEqual (os .path .basename (src_ref .path ), "preprocessor.rdl" )
75
+ self .assertEqual (os .path .basename (src_ref .path ), os . path . basename ( self . src ) )
76
76
self .assertEqual (src_ref .line , 13 )
77
77
self .assertEqual (src_ref .line_selection , (12 , 22 ))
78
78
@@ -86,14 +86,14 @@ def test_src_ref_translation(self):
86
86
with self .subTest ("reg2 inst" ):
87
87
src_ref = root .find_by_path ("top.reg2" ).inst .inst_src_ref
88
88
89
- self .assertEqual (os .path .basename (src_ref .path ), "preprocessor.rdl" )
89
+ self .assertEqual (os .path .basename (src_ref .path ), os . path . basename ( self . src ) )
90
90
self .assertEqual (src_ref .line , 27 )
91
91
self .assertEqual (src_ref .line_selection , (11 , 14 ))
92
92
93
93
with self .subTest ("reg3 inst" ):
94
94
src_ref = root .find_by_path ("top.reg3" ).inst .inst_src_ref
95
95
96
- self .assertEqual (os .path .basename (src_ref .path ), "preprocessor.rdl" )
96
+ self .assertEqual (os .path .basename (src_ref .path ), os . path . basename ( self . src ) )
97
97
self .assertEqual (src_ref .line , 28 )
98
98
self .assertEqual (src_ref .line_selection , (4 , 22 ))
99
99
0 commit comments