summaryrefslogtreecommitdiff
path: root/update-test.sh
diff options
context:
space:
mode:
authorUlrich Windl <Ulrich.Windl@RZ.Uni-Regensburg.DE>2017-09-28 09:14:50 +0200
committerUlrich Windl <Ulrich.Windl@RZ.Uni-Regensburg.DE>2017-09-28 09:14:50 +0200
commit09f0179cf9022922aa856d3b2adc483b4dc5c9c2 (patch)
treed80f0d57fb7cc9d84e8504c105818c6d87b6f023 /update-test.sh
parentd42caa312811012da8b04641de8fbdca8fdc06ea (diff)
downloadtcpdump-09f0179cf9022922aa856d3b2adc483b4dc5c9c2.tar.gz
Provide and suggest update-test.sh in CONTRIBUTING
Provide shell script to update the output for a single test, and suggest using it in CONTRIBUTING.
Diffstat (limited to 'update-test.sh')
-rwxr-xr-xupdate-test.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/update-test.sh b/update-test.sh
new file mode 100755
index 00000000..60359d48
--- /dev/null
+++ b/update-test.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+TEST="$1"
+PREFIX=tests
+MATCH=0
+while read name input output options
+do
+ [ _$name = _ ] && continue # ignore empty lines
+ [ _${name#\#} != _$name ] && continue # ignore comment lines
+ [ $name != "$TEST" ] && continue # not the requested test
+ [ _$output = _ ] && continue # ignore incomplete lines
+ MATCH=1
+ ./tcpdump -n -t -r "$PREFIX/$input" $options >"$PREFIX/$output"
+done < $PREFIX/TESTLIST
+[ $MATCH = 0 ] && echo "test $TEST not found" >&2