4 TEST_ARGS="--lookup-policy=nonabsolute"
5 WORKDIR=`mktemp -d ${TMPDIR:-/tmp}/${TEST_PGM}.XXXXXXXXXX`
6 [[ -n "$WORKDIR" ]] && [[ -d "$WORKDIR" ]] || [[ -w "$WORKDIR" ]] || exit 1
8 # Clean up if we're not debugging.
9 [[ -z "$DEBUG" ]] && trap "[[ -d \"$WORKDIR\" ]] && rm -rf \"$WORKDIR\"" EXIT
11 OUTPUT_FILE=${WORKDIR}/out.txt
13 export FHICL_FILE_PATH="$WORKDIR"
16 ${TEST_PGM} ${TEST_ARGS} > ${OUTPUT_FILE} <<EOF
19 [[ ${STATUS} ]] || exit ${STATUS}
20 [[ -r ${OUTPUT_FILE} ]] || exit 11
21 [[ ! -s ${OUTPUT_FILE} ]] || exit 12
24 ${TEST_PGM} ${TEST_ARGS} - > ${OUTPUT_FILE} <<EOF
28 [[ ${STATUS} ]] || exit ${STATUS}
29 [[ -r ${OUTPUT_FILE} ]] || exit 21
30 [[ -s ${OUTPUT_FILE} ]] || exit 22
33 ${TEST_PGM} ${TEST_ARGS} a b c > ${OUTPUT_FILE}
35 [[ ${STATUS} == 3 ]] || exit ${STATUS}
41 FEXPECTED=${WORKDIR}/expected.txt
54 cat - > ${FEXPECTED} <<EOF
60 ${TEST_PGM} ${TEST_ARGS} ${F3} > ${OUTPUT_FILE}
62 [[ ${STATUS} ]] || exit ${STATUS}
63 cmp ${FEXPECTED} ${OUTPUT_FILE} || exit 31