Add a sample Makefile for regression testing by using tethereal.
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 12 May 2000 05:47:00 +0000 (05:47 +0000)
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 12 May 2000 05:47:00 +0000 (05:47 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1947 f5534014-38df-0310-8fa8-9805f1628bb7

Makefile.am
doc/README.regression [new file with mode: 0644]

index f77f80fd2dadb190afcfd3e9669ce654d5472ec0..9166eb349e45a09c8f321aa813be9537deefb776 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal
 #
-# $Id: Makefile.am,v 1.196 2000/05/12 03:59:55 gram Exp $
+# $Id: Makefile.am,v 1.197 2000/05/12 05:46:47 gram Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@zing.org>
@@ -467,6 +467,7 @@ EXTRA_DIST = \
        doc/README.developer    \
        doc/Makefile.in         \
        doc/Makefile.am         \
+       doc/README.regression   \
        doc/dfilter2pod.in      \
        doc/editcap.pod         \
        doc/ethereal.pod.template \
diff --git a/doc/README.regression b/doc/README.regression
new file mode 100644 (file)
index 0000000..8ce9b4f
--- /dev/null
@@ -0,0 +1,78 @@
+#
+# Ethereal/Tethereal Regression Testing
+#
+# $Id: README.regression,v 1.1 2000/05/12 05:47:00 gram Exp $
+#
+# This is a sample Makefile for regression testing of the
+# Ethereal engine. These tests use that uses 'tethereal -V' to analyze all
+# the frames of a capture file.
+#
+# You should probably rename this file as 'Makefile' in a separate directory
+# set aside for the sole purpose of regression testing. Two text files will
+# be created for each capture file you test, so expect to have lots of files.
+#
+# Set TETHEREAL, CAPTURE_DIR, and CAPTURE_FILES to values appropriate for
+# your system. Run 'make' to create the initial datasets. Type 'make accept'
+# to accept those files as the reference set.
+#
+# After you make changes to Tethereal, run 'make regress'. This will re-run
+# the tests and compare them against the accepted reference set of data.
+# The comparison, which is just an invocation of 'diff -u' for the output
+# of each trace file, will be put into a file called 'regress'. Examine
+# this file for any changes that you did or did not expect. 
+#
+# If you have introduced a change to Tethereal that shows up in the tests, but
+# it is a valid change, run 'make accept' to accept those new data as your
+# reference set. 
+#
+# Commands:
+#
+# 'make'               Creates tests
+# 'make regress'       Checks tests against accepted reference test results
+#                      Report is put in file 'regress'
+# 'make accept'                Accept current tests; make them the reference test results
+# 'make clean'         Cleans any tests (but not references!)
+
+TETHEREAL=/home/gram/prj/ethereal/debug/linux-ix86/tethereal
+
+CAPTURE_DIR=/home/gram/prj/sniff
+
+CAPTURE_FILES=\
+       dhcp-g.tr1      \
+       genbroad.snoop  \
+       ipv6-ripng.gz   \
+       ipx.pcap        \
+       pcmjh03.tr1     \
+       strange.iptrace \
+       teardrop.toshiba.gz     \
+       zlip-1.pcap     \
+       zlip-2.pcap     \
+       zlip-3.pcap
+
+######################################## No need to modify below this line
+
+TESTS = $(CAPTURE_FILES:=.tether)
+REFERENCES = $(TESTS:.tether=.ref)
+
+all:   $(TESTS)
+
+clean:
+       rm -f $(TESTS)
+
+%.tether : $(CAPTURE_DIR)/%
+       $(TETHEREAL) -V -n -r $< > $@
+
+accept: $(REFERENCES)
+
+%.ref : %.tether
+       cp $< $@
+
+regress: $(TETHEREAL) $(TESTS)
+       @echo "Regression Report"                       > regress
+       @date                                           >> regress
+       @echo "BOF------------------------------------" >> regress
+       @for file in $(CAPTURE_FILES); do \
+               echo Checking regression of $$file ; \
+               diff -u $${file}.ref $${file}.tether    >> regress ; \
+       done
+       @echo "EOF------------------------------------" >> regress