|
253 | 253 | 'runtime/string',
|
254 | 254 | 'runtime/threadsafe_fn',
|
255 | 255 | 'runtime/vlog',
|
| 256 | + 'runtime/catch_scenario', |
256 | 257 | 'whitespace/blank_line',
|
257 | 258 | 'whitespace/braces',
|
258 | 259 | 'whitespace/comma',
|
@@ -6149,6 +6150,25 @@ def AssembleString(clean_lines, start_lineno, start_linepos, end_lineno, end_lin
|
6149 | 6150 | full_string += clean_lines.elided[end_lineno][:end_linepos]
|
6150 | 6151 | return full_string
|
6151 | 6152 |
|
| 6153 | +def CheckScenarioHasTags(filename, clean_lines, linenum, error): |
| 6154 | + line = clean_lines.elided[linenum] |
| 6155 | + scenario = Match(r'^SCENARIO\(', line) |
| 6156 | + if not scenario: return |
| 6157 | + |
| 6158 | + closing_line, closing_linenum, closing_pos = CloseExpression(clean_lines, linenum, line.find('(')) |
| 6159 | + |
| 6160 | + if closing_pos == -1: |
| 6161 | + error(filename, linenum, |
| 6162 | + 'runtime/catch_scenario', 4, "Can't find closing bracket for scenario") |
| 6163 | + |
| 6164 | + full_string = AssembleString( |
| 6165 | + clean_lines, linenum, line.find('(') + 1, closing_linenum, closing_pos - 1) |
| 6166 | + |
| 6167 | + if(full_string.find(',') == -1): |
| 6168 | + error(filename, linenum, |
| 6169 | + 'runtime/catch_scenario', 4, "Can't find `,\' seperating scenario name and the tags: " + str(clean_lines.lines[linenum])) |
| 6170 | + |
| 6171 | + |
6152 | 6172 | def CheckRedundantVirtual(filename, clean_lines, linenum, error):
|
6153 | 6173 | """Check if line contains a redundant "virtual" function-specifier.
|
6154 | 6174 |
|
@@ -6342,6 +6362,7 @@ def ProcessLine(filename, file_extension, clean_lines, line,
|
6342 | 6362 | CheckInvalidIncrement(filename, clean_lines, line, error)
|
6343 | 6363 | CheckMakePairUsesDeduction(filename, clean_lines, line, error)
|
6344 | 6364 | CheckRedundantVirtual(filename, clean_lines, line, error)
|
| 6365 | + CheckScenarioHasTags(filename, clean_lines, line, error) |
6345 | 6366 | CheckNamespaceOrUsing(filename, clean_lines, line, error)
|
6346 | 6367 | CheckForEndl(filename, clean_lines, line, error)
|
6347 | 6368 | for check_fn in extra_check_functions:
|
|
0 commit comments