#!@KSH@ set -x # Compare statistics output by the compiler. Do not run the program. # Clear files > tc-out.new > tc-out.new.norm > tc-out.old > tc-out.old.norm # Execute tests case $1 in *.tc-out) BASENAME="${TS_HOME_DIRECTORY}/${1%%.tc-out}" SRCFILE="${BASENAME}.ti" if [[ ! -f "${SRCFILE}" ]] ; then echo "expected stats file ${SRCFILE} does not exist!" exit 5 fi # Compile echo Compiling $SRCFILE ${TS_BUILD_DIRECTORY}/bin/watchdog 900 5000 ${SS_COMPILER} ${SS_DEFAULT_COMPILER_FLAGS} ${SS_COMPILER_FLAGS} --classlib-pre `dirname ${BASENAME}` ${SRCFILE} > tc-out.new || exit 10 # this leaves junk laying around in the source tree (which may be disjoint from the build tree) # WORK_DIR=`pwd` # (cd ${TS_HOME_DIRECTORY}/${SS_SUITE} && \ # ${SS_COMPILER} ${SS_COMPILER_FLAGS} ${TS_HOME_DIRECTORY}/$1 && \ # cd ${WORK_DIR}) > tc-out.new || exit 10 # Normalize if [[ -x "${BASENAME}.norm" ]] ; then NORMALIZER="${BASENAME}.norm" else if [[ ! -z "${SS_NORMALIZER}" && -x "${SS_NORMALIZER}" ]] ; then NORMALIZER="${SS_NORMALIZER}" else NORMALIZER="cat" fi fi ${NORMALIZER} < tc-out.new > tc-out.new.norm || exit 30 # Validate if [[ -r "${BASENAME}.tc-out" ]] ; then cp -f ${BASENAME}.tc-out tc-out.old || exit 50 else > tc-out.old fi ${NORMALIZER} < tc-out.old > tc-out.old.norm || exit 70 diff -b tc-out.old.norm tc-out.new.norm | fgrep "Loop stats" && exit 100 ;; *) # Unknown file type exit 110 ;; esac # Done and passed exit 0