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