Skip to content

Commit

Permalink
Fixing up tests
Browse files Browse the repository at this point in the history
Getting rid of assumptions in tests that rely on the file structure further up than the copy point. This
includes the relative location of the executable.

Also removing the empty executable option. While this isn't an unreasonable test, we don't have a good
capability today to run a test that relies on a relative path outside of the installed tree. We may re-add
this capability at a later date. By switching all the useability tests back to RunApp we can't control the
CLI arguments that are passed to the application, invalidating the need for that test.

refs idaholab#19022
  • Loading branch information
permcody committed Mar 12, 2022
1 parent a6a23d1 commit 7059a08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion test/tests/parser/multiple_inputs/tests
Expand Up @@ -23,7 +23,7 @@
[three_inputs_error]
type = 'RunException'
input = 'diffusion1a.i diffusion1c.i diffusion1d.i'
expect_err = 'test/tests/parser/multiple_inputs/diffusion1d.i:3: unused parameter '
expect_err = '/diffusion1d.i:3: unused parameter '
'\'BCs/right/invalid_param\''
detail = 'while locating input errors in the correct file'
[]
Expand Down
44 changes: 19 additions & 25 deletions test/tests/usability/tests
@@ -1,68 +1,62 @@
[Tests]
# These tests intentionally use 'command' to demonstrate the command-line usability.
issues = "#16410"
design = "sqa/non_functional.md"
collections = USABILITY
[command-line]
requirement = "The system will be operated using a command-line interface that"
[empty]
type = RunCommand
method = opt
command = "../../moose_test-opt"
type = RunApp
no_additional_cli_args = True
expect_out = "Usage: \S+"

detail = "reports the available options in non are provided and"
detail = "reports the available options when none are provided and"
[]
[flags]
type = RunCommand
method = opt
command = "../../moose_test-opt --help"
type = RunApp
cli_args = "--help"
no_additional_cli_args = True
expect_out = "Usage: \S+"

detail = "accepts defined command-line flags."
[]
[]
[input]
requirement = "The system will be operated using"
[input_file]
type = RunCommand
method = opt
command = "../../moose_test-opt -i input.i"
type = RunApp
input = 'input.i'

detail = "an input file and"
[]
[command_line]
type = RunCommand
method = opt
command = "../../moose_test-opt -i input.i Mesh/uniform_refine=1"
type = RunApp
input = 'input.i'
cli_args = "Mesh/uniform_refine=1"

detail = "command-line options."
[]
[]

# The following tests do not use RunCommand, but use the 'command' parameter to demonstrate
# the actual command being run for usability. The application of mpiexec by RunApp/Exception
# is not designed to be used with 'command', so 'max_parallel' is set to one.
[message]
type = RunApp
method = opt
command = "../../moose_test-opt -i input.i invalid_command=1"
expect_out = "unused parameter 'invalid_command'"
type = RunException
input = 'input.i'
cli_args = "invalid_command=1"
expect_err = "unused parameter 'invalid_command'"
max_parallel = 1

requirement = "The system shall return usage messages when unidentified arguments or incorrectly used arguments are passed."
[]
[diagnostic]
type = RunException
method = opt
command = "../../moose_test-opt -i bad.i"
input = 'bad.i'
expect_err = "bad.i:13: missing closing '\[\]' for section"
max_parallel = 1

requirement = "The system shall provide diagnostics when the input file fails to parse, or the format is incorrect."
[]
[normal]
type = RunApp
method = opt
command = "../../moose_test-opt -i input.i"
input = 'input.i'
expect_out = "Framework Information"
max_parallel = 1

Expand Down

0 comments on commit 7059a08

Please sign in to comment.