Lines Matching refs:line
78 '''Analyze command line arguments'''
91 '''Set options specified on command line'''
148 '''Set input files specified on command line'''
180 line = file.readline()
181 if not line:
185 scanInputLine( fileName, lineNo, line )
189 def scanInputLine( fileName, lineNo, line ):
190 '''Scan single input line for interesting stuff'''
191 scanLineForExceptionHandling( line )
192 scanLineForStandardLibrary( line )
194 scanLineForSuiteStart( fileName, lineNo, line )
198 scanLineInsideSuite( suite, lineNo, line )
200 def scanLineInsideSuite( suite, lineNo, line ):
201 '''Analyze line which is part of a suite'''
203 if lineBelongsToSuite( suite, lineNo, line ):
204 scanLineForTest( suite, lineNo, line )
205 scanLineForCreate( suite, lineNo, line )
206 scanLineForDestroy( suite, lineNo, line )
208 def lineBelongsToSuite( suite, lineNo, line ):
209 '''Returns whether current line is part of the current suite.
211 If the suite is generated, adds the line to the list of lines'''
217 inBlock = lineStartsBlock( line )
219 inBlock = addLineToBlock( suite, lineNo, line )
224 def scanLineForStandardLibrary( line ):
225 '''Check if current line uses standard library'''
227 if not haveStandardLibrary and std_re.search(line):
232 def scanLineForExceptionHandling( line ):
233 '''Check if current line uses exception handling'''
235 if not haveExceptionHandling and exception_re.search(line):
241 def scanLineForSuiteStart( fileName, lineNo, line ):
242 '''Check if current line starts a new test suite'''
243 m = suite_re.search( line )
246 m = generatedSuite_re.search( line )
251 def startSuite( name, file, line, generated ):
258 'line' : line,
266 def lineStartsBlock( line ):
267 '''Check if current line starts a new CXXTEST_CODE() block'''
268 return re.search( r'\bCXXTEST_CODE\s*\(', line ) is not None
271 def scanLineForTest( suite, lineNo, line ):
272 '''Check if current line starts a test'''
273 m = test_re.search( line )
277 def addTest( suite, name, line ):
283 'line' : line,
287 def addLineToBlock( suite, lineNo, line ):
288 '''Append the line to the current CXXTEST_CODE() block'''
289 line = fixBlockLine( suite, lineNo, line )
290 line = re.sub( r'^.*\{\{', '', line )
292 e = re.search( r'\}\}', line )
294 line = line[:e.start()]
295 suite['lines'].append( line )
298 def fixBlockLine( suite, lineNo, line):
299 '''Change all [E]TS_ macros used in a line to _[E]TS_ macros with the correct file/line'''
302 line, 0 )
305 def scanLineForCreate( suite, lineNo, line ):
306 '''Check if current line defines a createSuite() function'''
307 if create_re.search( line ):
311 def scanLineForDestroy( suite, lineNo, line ):
312 '''Check if current line defines a destroySuite() function'''
313 if destroy_re.search( line ):
321 def addSuiteCreateDestroy( suite, which, line ):
324 abort( '%s:%s: %sSuite() already declared' % ( suite['file'], str(line), which ) )
325 suite[which] = line
373 line = template.readline()
374 if not line:
376 if include_re.search( line ):
378 output.write( line )
379 elif preamble_re.search( line ):
381 elif world_re.search( line ):
384 output.write( line )
491 for line in suite['lines']:
492 output.write(line)
524 (test['class'], suite['tlist'], suite['dobject'], test['line'], test['name']) )
553 (suite['cfile'], suite['line'], suite['name'], suite['tlist'],
562 (suite['cfile'], suite['line'], suite['name'], suite['object'], suite['tlist']) )
579 (suite['dobject'], suite['cfile'], suite['line'], suite['name'],
583 (suite['dobject'], suite['cfile'], suite['line'], suite['name'],
588 (test['object'], suite['tlist'], suite['dobject'], test['line'], test['name']) )