#!/bin/bash # $HeadURL$ $LastChangedRevision$ PROGNAME=${0##*/} echo "loading support modules ..." . $(ade-config ade_share_prefix)/include/adetestsupport.sh echo "setting up environment ..." SANDPIT=$(pwd) # We are going to install this module into a temp directory, with absolutely # no deferring to environment variables or to the contents of the -config.sh # script. First we need to work out the name of the script and also the # environment variable prefix, both of which depend on the name of the module, # which we don't know yet. So get that first. MODULE=$(ls $ADETEST_MODROOT/bin | sed -n 's/devsh.sh//p') UC_MODULE=${MODULE^^} [ "X$MODULE" != X ] || adetestsupport_error "can't get the name of this module" # Now we can unset environment variables set by *this* module's *-devsh # script, which we may be running under. eval "$(env | sed -nr "s/^(${UC_MODULE}_[A-Z_]+=).*/\\1/p")" echo "copying sources from working copy to sandpit and blanking settings in *-config.sh ..." cp -ar $ADETEST_MODROOT sources cd sources MODULE_CONFIG_SH=bin/$MODULE-config.sh perl -pi -e "s@^(${UC_MODULE}_(?:|LIB_|DOC_|BIN_|SHARE_|MAN_|MAN1_|MAN2_|MAN3_|MAN4_|MAN5_|MAN6_|MAN7_|MAN8_|ETC_|STATE_|LOG_)PREFIX)=.*@\$1=@;" $MODULE_CONFIG_SH echo "remaking ..." make clean distclean > /dev/null 2>&1 make > /dev/null 2>&1 echo "running main test ..." mkdir tmp for MODE in direct indirect; do for FORMAT in shell man perl plain make encapsulated-make cpp; do echo "$MODE,$FORMAT" echo case $MODE-$FORMAT in direct-*) OPT=--$MODE ;; *-shell) OPT=--indirect=tmp/$PROGNAME.sh ;; *-man) OPT=--indirect=tmp/$PROGNAME.1 ;; *-encapsulated-make) OPT=--indirect=tmp/$PROGNAME.mk ;; *-make) OPT=--indirect=tmp/$PROGNAME.mk ;; *-plain) OPT=--indirect=tmp/$PROGNAME.txt ;; *-perl) OPT=--indirect=tmp/$PROGNAME.pl ;; *-*) OPT=--indirect=tmp/$PROGNAME.$FORMAT ;; esac env -i bin/ade-config --format=$FORMAT $OPT 2>&1 | sed 's/^/ /' echo done done echo "all done"