#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=${0##*/} SANDPIT=$(pwd) . $(ade-config ade_share_prefix)/include/adetestsupport.sh ############################################################################## # # LOAD TEST-SPECIFIC CONFIGURATION FILE # ############################################################################## [ "X$ADETEST_MODROOT" != X ] || adetestsupport_error "'ADETEST_MODROOT' not defined" [ -r "$ADETEST_MODROOT/tests/in/$PROGNAME" ] || adetestsupport_error "can't read $ADETEST_MODROOT/tests/in/$PROGNAME" . "$ADETEST_MODROOT/tests/in/$PROGNAME" || adetestsupport_error "problem sourcing $ADETEST_MODROOT/tests/in/$PROGNAME" [ "X$PROGRAMS" != X ] || adetestsupport_error "'PROGRAMS' not defined" ############################################################################## # # START OF TESTS # ############################################################################## echo "checking exit codes with '-p' ..." for PROGRAM in $PROGRAMS; do # The value of $PROGRAM may contain hyphens, but OPTIONS_$PROGRAM is not # allowed to or it is not a valid variable name. So 'sed' them out. eval OPTIONS=\"\$OPTIONS_$(echo $PROGRAM | sed 's/-/_/g')\" adetestsupport_debug 4 "calling '$PROGRAM $OPTIONS -p' and checking return code ..." $PROGRAM $OPTIONS -p > /dev/null done echo "checking exit codes with '--paths' ..." for PROGRAM in $PROGRAMS; do # The value of $PROGRAM may contain hyphens, but OPTIONS_$PROGRAM is not # allowed to or it is not a valid variable name. So 'sed' them out. eval OPTIONS=\"\$OPTIONS_$(echo $PROGRAM | sed 's/-/_/g')\" adetestsupport_debug 4 "calling '$PROGRAM $OPTIONS -p' and checking return code ..." $PROGRAM $OPTIONS --paths > /dev/null done echo "checking reply format with '-p' ..." for PROGRAM in $PROGRAMS; do # The value of $PROGRAM may contain hyphens, but OPTIONS_$PROGRAM is not # allowed to or it is not a valid variable name. So 'sed' them out. eval OPTIONS=\"\$OPTIONS_$(echo $PROGRAM | sed 's/-/_/g')\" adetestsupport_debug 4 "running '$PROGRAM $OPTIONS -p' and checking reply format ..." $PROGRAM $OPTIONS -p | sed "/^[-A-Za-z]*: \~\{0,1\}[-,_A-Za-z/\.0-9]*$/d" done echo "checking reply format with '--paths' ..." for PROGRAM in $PROGRAMS; do # The value of $PROGRAM may contain hyphens, but OPTIONS_$PROGRAM is not # allowed to or it is not a valid variable name. So 'sed' them out. eval OPTIONS=\"\$OPTIONS_$(echo $PROGRAM | sed 's/-/_/g')\" adetestsupport_debug 4 "running '$PROGRAM $OPTIONS --paths' and checking reply format ..." $PROGRAM $OPTIONS --paths | sed "/^[-A-Za-z]*: \~\{0,1\}[-,_A-Za-z/\.0-9]*$/d" done