13.3. Listing And Running Tests

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

$ python3 test/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
$ python3 test/test.py -l
$ python3 test/test.py -l all
$ python3 test/test.py --list
$ python3 test/test.py --list all

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

# List all suites
$ python3 test/test.py --list-suites

# List all suites and cases
$ python3 test/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
$ python3 test/test.py
$ python3 test/test.py all

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

# Run the "clopts" suite
$ python3 test/test.py suite_clopts

Run python3 test/test.py --help for all available options.