]> The Tcpdump Group git mirrors - tcpdump/blobdiff - update-test.sh
CI: Add warning exemptions for Sun C (suncc-5.15) on Solaris 10
[tcpdump] / update-test.sh
index 60359d48dd2c7b7edee07ac919fcec62dd0485d4..be93e1d3bee0e488ea638c30f34c664b696caee9 100755 (executable)
@@ -1,14 +1,22 @@
 #!/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
+
+TZ=GMT0; export TZ
+
+for TEST in "$@"; do
+    PREFIX=tests
+    MATCH=0
+    while read -r name input output options
+    do
+        [ -z "$name" ] && continue        # ignore empty lines
+        [ "${name#\#}" != "$name" ] && continue    # ignore comment lines
+        [ "$name" != "$TEST" ] && continue    # not the requested test
+        [ -z "$output" ] && continue    # ignore incomplete lines
+        MATCH=1
+        # Word splitting is intentional for $options.
+        # shellcheck disable=SC2086
+        ./tcpdump -# -n -tttt -r "$PREFIX/$input" $options >"$PREFIX/$output"
+    done < $PREFIX/TESTLIST
+    [ $MATCH = 0 ] && echo "test $TEST not found" >&2
+done