diff --git a/python/TestHarness/TestHarness.py b/python/TestHarness/TestHarness.py index 78475de55d00..d476d5bf29eb 100644 --- a/python/TestHarness/TestHarness.py +++ b/python/TestHarness/TestHarness.py @@ -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") @@ -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: diff --git a/python/TestHarness/testers/RunApp.py b/python/TestHarness/testers/RunApp.py index b3c8d41f78e0..10917fa2b843 100644 --- a/python/TestHarness/testers/RunApp.py +++ b/python/TestHarness/testers/RunApp.py @@ -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: