13.4. Listing And Running Tests

Tests can be run via the test.py Python script. To run all tests, either run test.py in the directory that contains the Wireshark executables (wireshark, tshark, etc.), or pass the the executable path via the -p flag:

$ python test.py -p /path/to/wireshark-build/run

You can list tests by passing one or more complete or partial names to tshark.py. The -l flag lists tests. By default all tests are shown.

# List all tests
$ python test.py -l
$ python test.py -l all
$ python test.py --list
$ python test.py --list all

# List only tests containing "dumpcap"
$ python test.py -l dumpcap

# List all suites
$ python test.py --list-suites

# List all suites and cases
$ python test.py --list-cases

If one of the listing flags is not present, tests are run. If no names or all is supplied, all tests are run. Otherwise tests that match are run.

# Run all tests
$ python test.py
$ python test.py all

# Only run tests containing "dumpcap"
$ python test.py -l dumpcap

# Run the "clopts" suite
$ python test.py suite_clopts