cp $BOXDIR/.stdout $TDIR/$TEST.out
;;
esac
+
+ if [ -n "$OUTPUT_FILTER" -a "$OUT_TYPE" != none -a -z "$EV_NOFILTER" ] ; then
+ pcont "<filter> "
+ FILTER=`eval echo \"$OUTPUT_FILTER\"`
+ echo "Output filter command: $FILTER"
+ mv $TDIR/$TEST.out $TDIR/$TEST.raw
+ if ! eval $FILTER 2>$TMPDIR/exec.out ; then
+ cat $TMPDIR/exec.out
+ MSG=`tail -1 $TMPDIR/exec.out`
+ if [ -z "$MSG" ] ; then MSG="Filter failed" ; fi
+ test-result 0 "$MSG"
+ fi
+ cat $TMPDIR/exec.out
+ fi
}
# Running of test program with file input/output
[ -n "$SYNTAX_CHECK" ] || return 0
[ -z "$EV_NOCHECK" ] || return 0
pcont "<syntax> "
- SCHECK=`eval echo $SYNTAX_CHECK`
+ SCHECK=`eval echo \"$SYNTAX_CHECK\"`
echo "Syntax check command: $SCHECK"
if ! eval $SCHECK 2>$TMPDIR/exec.out ; then
cat $TMPDIR/exec.out
if [ -n "$OUTPUT_CHECK" -a "$OUT_TYPE" != none -a -z "$EV_NOCHECK" ] ; then
pcont "<check> "
[ -f $PDIR/$TEST.out ] && ln $PDIR/$TEST.out $TDIR/$TEST.ok
- OCHECK=`eval echo $OUTPUT_CHECK`
+ OCHECK=`eval echo \"$OUTPUT_CHECK\"`
echo "Output check command: $OCHECK"
if ! eval $OCHECK 2>$TMPDIR/exec.out ; then
cat $TMPDIR/exec.out
# Memory limit in kilobytes
MEM_LIMIT=16384
+# Command used for filtering of program output (optional)
+# If turned on, program output (*.raw) is ran through this filter and the
+# checkers are applied to the output of the filter (*.out).
+# Can exit with code 1 if there is a syntax error in the output.
+#OUTPUT_FILTER='tr -d '\''\r'\'' <$TDIR/$TEST.raw >$TDIR/$TEST.out'
+
# Command used to check output syntax (optional)
# Returns exit code 1 if syntax is wrong, 0 if correct
# fd1 is connect to evaluator log, feel free to log anything
# DEBUG: Skip checks (useful when generating output files by running model solution)
#EV_NOCHECK=1
+
+# DEBUG: Skip output filters (if you suspect they are buggy)
+#EV_NOFILTER=1