diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-03-30 16:55:08 -0400 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-03-30 21:03:15 +0000 |
commit | 550e3153bf0f37a9297057c3c5024aa8809fd428 (patch) | |
tree | 21518c30159a6e3052d5e3d5153d62adc20ed856 /tools/test-captures.sh | |
parent | b63b5034569f861d6cca0354aaa5c25eda18558e (diff) |
Fix fuzz-test.sh '-b' option so it works again; Do some other tools/*test*.sh changes
- Add -b option to randpkt-test.sh and test-captures.sh;
- Create/ue a common function to do '-x' tests on files/dirs;
- Rename exit_error function to ws_exit_error
Change-Id: I032c9d784bec1fb6b0717aaad08a061e4d935476
Reviewed-on: https://code.wireshark.org/review/872
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
Diffstat (limited to 'tools/test-captures.sh')
-rwxr-xr-x | tools/test-captures.sh | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tools/test-captures.sh b/tools/test-captures.sh index 16df859e45..f4693e8b02 100755 --- a/tools/test-captures.sh +++ b/tools/test-captures.sh @@ -27,14 +27,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +TEST_TYPE="manual" +. `dirname $0`/test-common.sh || exit 1 + +while getopts ":b:" OPTCHAR ; do + case $OPTCHAR in + b) BIN_DIR=$OPTARG ;; + esac +done +shift $(($OPTIND - 1)) + if [ $# -lt 1 ] then - printf "Usage: $0 /path/to/file[s].pcap\n" + printf "Usage: $(basename $0) [-b bin_dir] /path/to/file[s].pcap\n" exit 1 fi -TEST_TYPE="manual" -. `dirname $0`/test-common.sh || exit 1 +ws_bind_exec_paths +ws_check_exec "$TSHARK" # set some limits to the child processes, e.g. stop it if it's running longer then MAX_CPU_TIME seconds # (ulimit is not supported well on cygwin and probably other platforms, e.g. cygwin shows some warnings) @@ -46,7 +56,7 @@ for file in "$@" do echo "Testing file $file..." echo -n " - with tree... " - if $BIN_DIR/tshark -nVxr $file > /dev/null + if $TSHARK -nVxr $file > /dev/null then echo "OK" echo -n " - without tree... " |