Skip to content

Commit

Permalink
display summary
Browse files Browse the repository at this point in the history
  • Loading branch information
pewniak747 committed Mar 20, 2012
1 parent 552381c commit b0f3a9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if [ ! -d $TMP_DIR ]; then
mkdir $TMP_DIR
fi

echo "compiling [$PROGRAM_NAME]"
if [ ! -e $SRC_FILE ]; then
echo "source not found!"
echo
Expand Down
14 changes: 10 additions & 4 deletions bin/judge
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ IN_DIR="$PROGRAM_DIR/in"
OUT_DIR="$PROGRAM_DIR/out"
CLEANUP=bin/cleanup

echo "checking [$PROGRAM_NAME]"
if [ ! -x $PROGRAM ]; then
echo "program not found!"
echo
Expand All @@ -20,9 +19,9 @@ fi

source $PROGRAM_DIR/$PROGRAM_NAME.conf

if [[ $FILES == "" ]]; then
FILES=`ls -v -m1 $IN_DIR/$PROGRAM_NAME*.in | xargs -n 1 basename`
fi
FILES=`ls -v -m1 $IN_DIR/$PROGRAM_NAME*.in | xargs -n 1 basename`
test_count=`ls $IN_DIR/$PROGRAM_NAME*.in | wc -l`
ac_count=0

for file in $FILES; do
infile=$IN_DIR/$file
Expand Down Expand Up @@ -50,13 +49,20 @@ for file in $FILES; do
color=31m
else
color=32m
ac_count=$[ $ac_count + 1 ]
fi
printf "\033[$color[$result]\033[0m\t$file - $time s\n"
if [[ $RESULT == 0 ]]; then
if [[ $result == WA ]]; then RESULT=1; fi
if [[ $result == TLE ]]; then RESULT=2; fi
fi
done
if [[ $ac_count == $test_count ]]; then
color=32m
else
color=31m
fi
printf "\033[$color[$ac_count/$test_count]\033[0m\t$PROGRAM_NAME\n"
echo

# cleanup
Expand Down

0 comments on commit b0f3a9b

Please sign in to comment.