@@ -46,9 +46,11 @@ def parse_test_cases(
46
46
i += 1
47
47
48
48
files = [] # type: List[Tuple[str, str]] # path and contents
49
+ tcout = [] # type: List[str] # Regular output errors
50
+ tcout2 = [] # type: List[str] # Output errors for incremental, second run
49
51
stale_modules = None # type: Optional[Set[str]] # module names
50
52
rechecked_modules = None # type: Optional[Set[str]] # module names
51
- while i < len (p ) and p [i ].id not in [ 'out' , ' case'] :
53
+ while i < len (p ) and p [i ].id != ' case' :
52
54
if p [i ].id == 'file' :
53
55
# Record an extra file needed for the test case.
54
56
files .append ((os .path .join (base_path , p [i ].arg ),
@@ -74,6 +76,16 @@ def parse_test_cases(
74
76
rechecked_modules = set ()
75
77
else :
76
78
rechecked_modules = {item .strip () for item in p [i ].arg .split (',' )}
79
+ elif p [i ].id == 'out' or p [i ].id == 'out1' :
80
+ tcout = p [i ].data
81
+ if native_sep and os .path .sep == '\\ ' :
82
+ tcout = [fix_win_path (line ) for line in tcout ]
83
+ ok = True
84
+ elif p [i ].id == 'out2' :
85
+ tcout2 = p [i ].data
86
+ if native_sep and os .path .sep == '\\ ' :
87
+ tcout2 = [fix_win_path (line ) for line in tcout2 ]
88
+ ok = True
77
89
else :
78
90
raise ValueError (
79
91
'Invalid section header {} in {} at line {}' .format (
@@ -88,21 +100,14 @@ def parse_test_cases(
88
100
raise ValueError (
89
101
'Stale modules must be a subset of rechecked modules ({})' .format (path ))
90
102
91
- tcout = [] # type: List[str]
92
- if i < len (p ) and p [i ].id == 'out' :
93
- tcout = p [i ].data
94
- if native_sep and os .path .sep == '\\ ' :
95
- tcout = [fix_win_path (line ) for line in tcout ]
96
- ok = True
97
- i += 1
98
- elif optional_out :
103
+ if optional_out :
99
104
ok = True
100
105
101
106
if ok :
102
107
input = expand_includes (p [i0 ].data , include_path )
103
108
expand_errors (input , tcout , 'main' )
104
109
lastline = p [i ].line if i < len (p ) else p [i - 1 ].line + 9999
105
- tc = DataDrivenTestCase (p [i0 ].arg , input , tcout , path ,
110
+ tc = DataDrivenTestCase (p [i0 ].arg , input , tcout , tcout2 , path ,
106
111
p [i0 ].line , lastline , perform ,
107
112
files , stale_modules , rechecked_modules )
108
113
out .append (tc )
@@ -129,11 +134,12 @@ class DataDrivenTestCase(TestCase):
129
134
130
135
clean_up = None # type: List[Tuple[bool, str]]
131
136
132
- def __init__ (self , name , input , output , file , line , lastline ,
137
+ def __init__ (self , name , input , output , output2 , file , line , lastline ,
133
138
perform , files , expected_stale_modules , expected_rechecked_modules ):
134
139
super ().__init__ (name )
135
140
self .input = input
136
141
self .output = output
142
+ self .output2 = output2
137
143
self .lastline = lastline
138
144
self .file = file
139
145
self .line = line
0 commit comments