diff options
author | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-05-03 12:26:30 +0200 |
---|---|---|
committer | Francois-Xavier Le Bail <devel.fx.lebail@orange.fr> | 2018-05-03 12:26:30 +0200 |
commit | 878c29b576d3842ddbe105fd5362bf9d37c9c5f0 (patch) | |
tree | e7575958e2a15c137caca94037071c1d0e92aed7 /update-test.sh | |
parent | 678f764388841e0f4d2b6a0844a561bae38fec53 (diff) | |
download | tcpdump-878c29b576d3842ddbe105fd5362bf9d37c9c5f0.tar.gz |
Change update-test.sh to update multiple tests
Diffstat (limited to 'update-test.sh')
-rwxr-xr-x | update-test.sh | 30 |
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 |