wireshark/test
Peter Wu 22cf80d30d text2pcap: gracefully handle hexdump without trailing LF
When copying hexdumps, the newline might be missing which would result
in a capture file missing one byte in its packet. Adjust the grammar to
recognize the two trailing hexadecimal characters as a "byte".

This is safe because Flex picks the rule that matches the longest input
string. So given "01 ", it will always match all three characters. If
something like "01x" is given, then the "text" rule will be matched (as
before). Only if no more characters are available (such as at the end of
a file), then the rule will match two hexdigits.

Remove the unnecessary hexdigit rule while at it.

Change-Id: I21dc37d684d1c410ce720cb27706a6e54f87f94d
Reviewed-on: https://code.wireshark.org/review/30190
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-13 05:16:22 +00:00
..
baseline Test: Add fileformats and I/O. 2018-04-27 19:52:04 +00:00
captures tcp: fix OoO reassembly when the first data packet is OoO 2018-08-30 04:07:01 +00:00
config ssl,http: rename http-over-ssl to http-over-tls 2016-09-04 13:18:54 +00:00
keys TLS13: add final tests for RFC 8446 2018-08-17 07:28:56 +00:00
lua Lua: remove various logging functions (debug, warn, etc.) 2018-09-07 04:02:45 +00:00
suite_dfilter ntp: make ntp.precision an uint8. 2018-09-04 09:05:24 +00:00
README.test Test: Remove the Bash test scripts. 2018-05-02 04:09:26 +00:00
config.py test: reduce further influence from the environment 2018-10-12 18:55:04 +00:00
conftest.py Tests: add minimal pytest support 2018-07-17 09:04:01 +00:00
hosts.custom
hosts.global
hosts.personal
pytest.ini Tests: add minimal pytest support 2018-07-17 09:04:01 +00:00
subprocesstest.py test: fix DeprecationWarning: invalid escape sequence 2018-10-12 18:53:21 +00:00
suite_capture.py Test: Consolidate our environments. 2018-05-22 16:34:03 +00:00
suite_clopts.py test: reduce further influence from the environment 2018-10-12 18:55:04 +00:00
suite_decryption.py test: fix DeprecationWarning: invalid escape sequence 2018-10-12 18:53:21 +00:00
suite_dissection.py Start renaming SSL to TLS. 2018-09-13 22:37:52 +00:00
suite_fileformats.py Test: Add fileformats and I/O. 2018-04-27 19:52:04 +00:00
suite_follow.py tests: add regression tests for Follow TCP Stream 2018-07-06 12:11:09 +00:00
suite_io.py Test: Add fileformats and I/O. 2018-04-27 19:52:04 +00:00
suite_mergecap.py test: fix DeprecationWarning: invalid escape sequence 2018-10-12 18:53:21 +00:00
suite_nameres.py test: add test for resolved addresses 2018-05-12 06:29:55 +00:00
suite_sharkd.py Test: Add sharkd tests. 2018-06-21 03:30:30 +00:00
suite_text2pcap.py text2pcap: gracefully handle hexdump without trailing LF 2018-10-13 05:16:22 +00:00
suite_unittests.py Test+CMake: Make our test grouping more fine-grained. 2018-06-18 19:36:26 +00:00
suite_wslua.py Test: Add wslua. 2018-05-02 00:35:20 +00:00
test.py Test+CMake: Make our test grouping more fine-grained. 2018-06-18 19:36:26 +00:00
util_dump_dhcp_pcap.py Test: Add fileformats and I/O. 2018-04-27 19:52:04 +00:00

README.test

Wireshark Tests

The main testing script is `test.py`. It will attempt to test as much as
possible by default, including packet capture. This means that you will
probably either have to supply a capture interface (`--capture-interface
<interface>`) or disable capture tests (`--disable-capture`). You must
also build the test-programs target in order for the unittests suite to
pass.

To run all tests from CMake do the following:
- Pass `-DTEST_EXTRA_ARGS=--disable-capture` or
  `-DTEST_EXTRA_ARGS=--capture-interface=<interface>`
  as needed for your system.
- Build the “test” target or run ctest, e.g. `ctest --force-new-ctest-process -j 4 --verbose`.

To run all tests directly, run `test.py -p
/path/to/wireshark-build/run-directory <capture args>`.

To see a list of all options, run `test.py -h` or `test.py --help`.

To see a list of all tests, run `test.py -l`.

See the “Wireshark Tests” chapter of the Developer's Guide for details.