本文整理汇总了Python中RunApp.RunApp.testFileOutput方法的典型用法代码示例。如果您正苦于以下问题:Python RunApp.testFileOutput方法的具体用法?Python RunApp.testFileOutput怎么用?Python RunApp.testFileOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RunApp.RunApp
的用法示例。
在下文中一共展示了RunApp.testFileOutput方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: processResults
# 需要导入模块: from RunApp import RunApp [as 别名]
# 或者: from RunApp.RunApp import testFileOutput [as 别名]
def processResults(self, moose_dir, options, output):
reason = ''
specs = self.specs
if self.hasRedirectedOutput(options):
redirected_output = util.getOutputFromFiles(self, options)
output += redirected_output
# Expected errors and assertions might do a lot of things including crash so we
# will handle them seperately
if specs.isValid('expect_err'):
if not util.checkOutputForPattern(output, specs['expect_err']):
reason = 'EXPECTED ERROR MISSING'
elif specs.isValid('expect_assert'):
if options.method in ['dbg', 'devel']: # Only check asserts in debug and devel modes
if not util.checkOutputForPattern(output, specs['expect_assert']):
reason = 'EXPECTED ASSERT MISSING'
# If we've set a reason right here, we should report the pattern that we were unable to match.
if reason != '':
output += "#"*80 + "\n\nUnable to match the following pattern against the program's output:\n\n" + specs['expect_err'] + "\n"
if reason == '':
RunApp.testFileOutput(self, moose_dir, options, output)
if reason != '':
self.setStatus(reason, self.bucket_fail)
else:
self.setStatus(self.success_message, self.bucket_success)
return output
示例2: processResults
# 需要导入模块: from RunApp import RunApp [as 别名]
# 或者: from RunApp.RunApp import testFileOutput [as 别名]
def processResults(self, moose_dir, options, output):
reason = ''
specs = self.specs
if self.hasRedirectedOutput(options):
redirected_output = util.getOutputFromFiles(self, options)
output += redirected_output
# Expected errors and assertions might do a lot of things including crash so we
# will handle them seperately
if specs.isValid('expect_err'):
if not util.checkOutputForPattern(output, specs['expect_err']):
reason = 'NO EXPECTED ERR'
elif specs.isValid('expect_assert'):
if options.method == 'dbg': # Only check asserts in debug mode
if not util.checkOutputForPattern(output, specs['expect_assert']):
reason = 'NO EXPECTED ASSERT'
if reason == '':
RunApp.testFileOutput(self, moose_dir, options, output)
if reason != '':
self.setStatus(reason, self.bucket_fail)
else:
self.setStatus(self.success_message, self.bucket_success)
return output
示例3: processResults
# 需要导入模块: from RunApp import RunApp [as 别名]
# 或者: from RunApp.RunApp import testFileOutput [as 别名]
def processResults(self, moose_dir, options, output):
RunApp.testFileOutput(self, moose_dir, options, output)
# Skip
specs = self.specs
if self.getStatus() == self.bucket_fail or specs['skip_checks']:
return output
# Don't Run VTKDiff on Scaled Tests
if options.scaling and specs['scale_refine']:
return output
# Loop over every file
for file in specs['vtkdiff']:
# Error if gold file does not exist
if not os.path.exists(os.path.join(specs['test_dir'], specs['gold_dir'], file)):
output += "File Not Found: " + os.path.join(specs['test_dir'], specs['gold_dir'], file)
self.setStatus('MISSING GOLD FILE', self.bucket_fail)
break
# Perform diff
else:
for file in self.specs['vtkdiff']:
gold = os.path.join(specs['test_dir'], specs['gold_dir'], file)
test = os.path.join(specs['test_dir'], file)
# We always ignore the header_type attribute, since it was
# introduced in VTK 7 and doesn't seem to be important as
# far as Paraview is concerned.
specs['ignored_attributes'].append('header_type')
differ = XMLDiffer(gold, test, abs_zero=specs['abs_zero'], rel_tol=specs['rel_err'], ignored_attributes=specs['ignored_attributes'])
# Print the results of the VTKDiff whether it passed or failed.
output += differ.message() + '\n'
if differ.fail():
self.addCaveats('VTKDIFF')
self.setStatus(self.bucket_skip.status, self.bucket_skip)
break
# If status is still pending, then it is a passing test
if self.getStatus() == self.bucket_pending:
self.setStatus(self.success_message, self.bucket_success)
return output
示例4: processResults
# 需要导入模块: from RunApp import RunApp [as 别名]
# 或者: from RunApp.RunApp import testFileOutput [as 别名]
def processResults(self, moose_dir, options, output):
return RunApp.testFileOutput(self, moose_dir, options, output)