summaryrefslogtreecommitdiff
path: root/update-test.sh
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-05-03 12:26:30 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-05-03 12:26:30 +0200
commit878c29b576d3842ddbe105fd5362bf9d37c9c5f0 (patch)
treee7575958e2a15c137caca94037071c1d0e92aed7 /update-test.sh
parent678f764388841e0f4d2b6a0844a561bae38fec53 (diff)
downloadtcpdump-878c29b576d3842ddbe105fd5362bf9d37c9c5f0.tar.gz
Change update-test.sh to update multiple tests
Diffstat (limited to 'update-test.sh')
-rwxr-xr-xupdate-test.sh30
1 files changed, 17 insertions, 13 deletions
diff --git a/update-test.sh b/update-test.sh
index 60359d48..8c7d0cab 100755
--- a/update-test.sh
+++ b/update-test.sh
@@ -1,14 +1,18 @@
#!/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
+
+# Update the tests given as positional parameters
+
+for TEST in "$@"; do
+ 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
+done