Skip to content

Commit

Permalink
Add output to the CheckFiles Tester so we can see what's going on
Browse files Browse the repository at this point in the history
refs #19022
  • Loading branch information
permcody committed Apr 1, 2022
1 parent 12d2e18 commit 4cc739d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions python/TestHarness/testers/CheckFiles.py
Expand Up @@ -41,17 +41,26 @@ def processResults(self, moose_dir, options, output):
else:
reason = ''
# if still no errors, check other files (just for existence)
errors = []
for file in self.specs['check_files']:
if not os.path.isfile(os.path.join(self.getTestDir(), file)):
full_path = os.path.abspath(os.path.join(self.getTestDir(), file))
if os.path.isfile(full_path):
errors.append('File "' + full_path + '" exists.')
else:
errors.append('File "' + full_path + '" does not exist but should.')
reason = 'MISSING FILES'
break
for file in self.specs['check_not_exists']:
if os.path.isfile(os.path.join(self.getTestDir(), file)):
full_path = os.path.abspath(os.path.join(self.getTestDir(), file))
if os.path.isfile(full_path):
errors.append('File "' + full_path + '" exists but should not.')
reason = 'UNEXPECTED FILES'
break
else:
errors.append('File "' + full_path + '" does not exist - ok.')

# if still no errors, check that all the files contain the file_expect_out expression
if reason == '':
if reason != '':
output += '\n' + '\n'.join(errors)
else:
# if still no errors, check that all the files contain the file_expect_out expression
if self.specs.isValid('file_expect_out'):
for file in self.specs['check_files']:
fid = open(os.path.join(self.getTestDir(), file), 'r')
Expand Down

0 comments on commit 4cc739d

Please sign in to comment.