#!@KSH@ set -x # $1 = error number # terminates test execution with an informative log message # outputs tcbuild settings to log function exit_err { ERRCODE=$1 case ${ERRCODE} in 10) echo "ERROR: compiler exited with non-zero status" ;; 110) echo "ERROR: Unknown file type in tester" ;; *) echo "ERROR: unknown error" ;; esac echo tcbuild configuration at failure: ${SS_COMPILER} ${SS_DEFAULT_COMPILER_FLAGS} ${SS_COMPILER_FLAGS} --settings "${TS_HOME_DIRECTORY}/$1" exit ${ERRCODE} } # Execute tests case $1 in *.ti | *.java) # Compile # kill the compiler if it runs for more than 15 minutes without output echo ${TS_BUILD_DIRECTORY}/bin/watchdog 900 5000 ${SS_COMPILER} ${SS_DEFAULT_COMPILER_FLAGS} ${SS_COMPILER_FLAGS} "${TS_HOME_DIRECTORY}/$1" ${TS_BUILD_DIRECTORY}/bin/watchdog 900 5000 ${SS_COMPILER} ${SS_DEFAULT_COMPILER_FLAGS} ${SS_COMPILER_FLAGS} "${TS_HOME_DIRECTORY}/$1" || exit_err 10 # Occasionally we get a false negative due to a "text file busy" error # if we attempt to execute immediately after linking completes sync sleep 1 # strip leading path PROGNAME=$(basename "$1" .ti) PROGNAME=$(basename "$PROGNAME" .java) PROGNAME=$(perl -e '$_ = '\'"$PROGNAME"\'' ; s/([^a-zA-Z0-9\-\.\@#!~])/\_/g ; print $_') TESTBASE=${1%%(.java|.ti)} exec $(dirname $0)/stdout_err_test_exe "${PROGNAME}" "${TESTBASE}" ;; *) exit_err 110 ;; esac