Skip to content

Commit

Permalink
Merge pull request #29190 from loganharbour/29189_allow_warnings
Browse files Browse the repository at this point in the history
Add --allow-warnings to the test harness
  • Loading branch information
GiudGiud authored Dec 4, 2024
2 parents efaef34 + 4f11a45 commit b4e638f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions python/TestHarness/TestHarness.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,7 @@ def parseCLArgs(self, argv):
parser.add_argument('--error-unused', action='store_true', help='Run the tests with errors on unused parameters (Pass "--error-unused" to executable)')
parser.add_argument('--error-deprecated', action='store_true', help='Run the tests with errors on deprecations')
parser.add_argument('--allow-unused',action='store_true', help='Run the tests without errors on unused parameters (Pass "--allow-unused" to executable)')
parser.add_argument('--allow-warnings',action='store_true', help='Run the tests with warnings not as errors (Do not pass "--error" to executable)')
# Option to use for passing unwrapped options to the executable
parser.add_argument('--cli-args', nargs='?', type=str, dest='cli_args', help='Append the following list of arguments to the command line (Encapsulate the command in quotes)')
parser.add_argument('--dry-run', action='store_true', dest='dry_run', help="Pass --dry-run to print commands to run, but don't actually run them")
Expand Down Expand Up @@ -1196,6 +1197,9 @@ def checkAndUpdateCLArgs(self):
if opts.verbose and opts.quiet:
print('Do not be an oxymoron with --verbose and --quiet')
sys.exit(1)
if opts.error and opts.allow_warnings:
print(f'ERROR: Cannot use --error and --allow-warnings together')
sys.exit(1)

# Setup absolute paths and output paths
if opts.output_dir:
Expand Down
2 changes: 1 addition & 1 deletion python/TestHarness/testers/RunApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def getCommand(self, options):
# and it is NOT supplied already in the cli-args option
cli_args.append('--distributed-mesh')

if '--error' not in cli_args and (not specs["allow_warnings"] or options.error):
if '--error' not in cli_args and (not specs["allow_warnings"] or options.error) and not options.allow_warnings:
cli_args.append('--error')

if '--error-unused' not in cli_args and options.error_unused:
Expand Down

0 comments on commit b4e638f

Please sign in to comment.