-
Notifications
You must be signed in to change notification settings - Fork 2
Test keywords
A test keyword is just a single word. They are arbitrary and can be defined using the "keywords" directive:
#VVT: keywords : 3D mhd circuit
There are two optional attributes that can be specified: testname and parameters. For example,
#VVT: keywords (testname=mytest, parameters="np>1") : 3D mhd circuit
The "keywords" directive can be used multiple times and all the keywords in each line are added to the test's keywords.
# VVT: keywords : foo bar
# VVT: keywords : baz
This test will have the three keywords "foo", "bar", and "baz".
The main use of test keywords are for filtering a set of tests, such as selecting which tests to run. For example, this command would run all tests that defined "mhd" as a keyword:
$ vvtest -k mhd
A test will always have a set of implicit keywords, which can be used in the same way as explicit keywords.
The test name is an implicit keyword, which is convenient for filtering by test name.
The basename of the test file is always an implicit keyword (regardless of testname settings). So a test file somefile.vvt
would have "somefile" as a keyword.
Implicit keywords also come from "parameterize" directives. The names of the parameters are added as test keywords. For example, this test
#VVT: parameterize : meshsize = 0.1 0.01 0.001
would have "meshsize" as a keyword.
And finally, the results of running the test are added as keywords. The result strings are
- notrun : the test has not been run
- notdone : the test is still running (or vvtest was killed while it was running)
- pass : the test ran and completed successfully
- diff : the test ran and completed with a numerical difference
- fail : the test ran but crashed for some reason (exited with a non-zero exit status)
- timeout : the test ran out of time and was killed
Note that a test that times out is also considered to have failed. So after the tests are run, you can say for example
$ vvtest -R -k diff/fail
which would rerun the tests that diff'ed or failed.