Skip to content

Scanning for test files

Richard R. Drake edited this page Jun 8, 2022 · 1 revision

When vvtest is run, the first thing it does is look for test files. By default, it recursively scans the current working directory for files named "*.vvt". Alternatively, you can tell it where your test files and directories are, by adding one or more paths on the command line:

$ ls -R ../tests
../tests:
atest.vvt  input.xml  subdir

../tests/subdir:
btest.vvt

$ vvtest -v ../tests
...
fail        0:01 01/01 08:20:32 TestResults.ceelan/atest
pass        0:01 01/01 08:20:32 TestResults.ceelan/subdir/btest
...

$ ls
TestResults.ceelan

Note that the TestResults.* subdirectory is still used for the test execution directories.

Selecting tests to run

By default, each test file found in the (recursive) scanning will be run. Listing directories and/or test files on the command line allow more control over which tests will be run, such as

$ vvtest mytests/atest.vvt mytests/subdir/btest.vvt

Tests can also be selected by filtering, using the -k and -p options. Filtering is a bigger topic, but a simple use of -k is to specify test names. For example, referring to the test structure above,

$ rm -rf TestResults*
$ vvtest -v -k btest ../tests
...
==================================================
pass        0:01 01/01 08:36:38 TestResults.ceelan/subdir/btest
==================================================
Summary:
    completed: 1
          1 pass
    skipped: 1
          1 due to "excluded by keyword expression"
    total: 2

Finish date: Sat Jan  1 08:36:39 2022 (elapsed time 1s)
Test directory: TestResults.ceelan

This time only "btest" was run. The output shows one test was skipped by keyword expression, which is "atest".

Clone this wiki locally