aboutsummaryrefslogtreecommitdiffstats
path: root/tools/test-common.sh
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2014-03-30 16:55:08 -0400
committerBill Meier <wmeier@newsguy.com>2014-03-30 21:03:15 +0000
commit550e3153bf0f37a9297057c3c5024aa8809fd428 (patch)
tree21518c30159a6e3052d5e3d5153d62adc20ed856 /tools/test-common.sh
parentb63b5034569f861d6cca0354aaa5c25eda18558e (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-common.sh')
-rw-r--r--tools/test-common.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/test-common.sh b/tools/test-common.sh
index e5e1e8cc69..1accdc0442 100644
--- a/tools/test-common.sh
+++ b/tools/test-common.sh
@@ -61,6 +61,8 @@ MAX_STACK=2033
# Insert z times an error into the capture file (0.02 seems to be a good value to find errors)
ERR_PROB=0.02
+# Call *after* any changes to BIN_DIR (e.g., via command-line options)
+function ws_bind_exec_paths() {
# Tweak the following to your liking. Editcap must support "-E".
TSHARK="$BIN_DIR/tshark"
EDITCAP="$BIN_DIR/editcap"
@@ -70,6 +72,20 @@ RANDPKT="$BIN_DIR/randpkt"
if [ "$BIN_DIR" = "." ]; then
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
fi
+}
+
+function ws_check_exec() {
+NOTFOUND=0
+for i in "$@" ; do
+ if [ ! -x "$i" ]; then
+ echo "Couldn't find \"$i\""
+ NOTFOUND=1
+ fi
+done
+if [ $NOTFOUND -eq 1 ]; then
+ exit 1
+fi
+}
##############################################################################
### Set up environment variables for fuzz testing ###
@@ -112,7 +128,7 @@ export MallocCheckHeapAbort=1
export MallocBadFreeAbort=1
# Create an error report
-function exit_error() {
+function ws_exit_error() {
echo -e "\n ERROR"
echo -e "Processing failed. Capture info follows:\n"
echo " Input file: $CF"