2 # Wireshark/TShark Regression Testing
4 # This is a sample Makefile for regression testing of the
5 # Wireshark engine. These tests use that uses 'tshark -V' to analyze all
6 # the frames of a capture file.
8 # You should probably rename this file as 'Makefile' in a separate directory
9 # set aside for the sole purpose of regression testing. Two text files will
10 # be created for each capture file you test, so expect to have lots of files.
12 # Set TSHARK, CAPTURE_DIR, and CAPTURE_FILES to values appropriate for
13 # your system. Run 'make' to create the initial datasets. Type 'make accept'
14 # to accept those files as the reference set.
16 # After you make changes to TShark, run 'make regress'. This will re-run
17 # the tests and compare them against the accepted reference set of data.
18 # The comparison, which is just an invocation of 'diff -u' for the output
19 # of each trace file, will be put into a file called 'regress'. Examine
20 # this file for any changes that you did or did not expect.
22 # If you have introduced a change to TShark that shows up in the tests, but
23 # it is a valid change, run 'make accept' to accept those new data as your
28 # 'make' Creates tests
29 # 'make regress' Checks tests against accepted reference test results
30 # Report is put in file 'regress'
31 # 'make accept' Accept current tests; make them the reference test results
32 # 'make clean' Cleans any tests (but not references!)
34 TSHARK=/home/gram/prj/wireshark/debug/linux-ix86/tshark
36 CAPTURE_DIR=/home/gram/prj/sniff
50 ######################################## No need to modify below this line
52 TESTS = $(CAPTURE_FILES:=.tether)
53 REFERENCES = $(TESTS:.tether=.ref)
60 %.tether : $(CAPTURE_DIR)/% $(TSHARK)
61 $(TSHARK) -V -n -r $< > $@
69 @echo "Regression Report" > regress
71 @echo "BOF------------------------------------" >> regress
72 @for file in $(CAPTURE_FILES); do \
73 echo Checking regression of $$file ; \
74 diff -u $${file}.ref $${file}.tether >> regress ; \
76 @echo "EOF------------------------------------" >> regress