#!/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 code with bad option '--qwerty' ..." for PROGRAM in $PROGRAMS; do adetestsupport_debug 4 "running '$PROGRAM --qwerty' ..." # '--quiet' needed otherwise a variable number of warnings are issued. adetestsupport_invert_rc --quiet "$PROGRAM --qwerty 2>/dev/null" || adetestsupport_error "'$PROGRAM --qwerty' did not exit non-zero and it should have done!" done echo "checking reply format with bad option '--qwerty' ..." for PROGRAM in $PROGRAMS; do adetestsupport_debug 4 "running '$PROGRAM --qwerty' ..." $PROGRAM --qwerty 2>&1 1>/dev/null | sed "/^$PROGRAM: ERROR: type '$PROGRAM --help' for correct usage\\.\$/d" done