From: Francois-Xavier Le Bail Date: Thu, 3 May 2018 10:26:30 +0000 (+0200) Subject: Change update-test.sh to update multiple tests X-Git-Tag: tcpdump-4.99-bp~1201 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/878c29b576d3842ddbe105fd5362bf9d37c9c5f0 Change update-test.sh to update multiple tests --- 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