Skip to content

Commit 0240050

Browse files
committed
write a simple test runner
1 parent d1ff36b commit 0240050

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

test.sh

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
FILENAME="test.txt"
2-
if [ -n $1 ]; then
3-
FILENAME=$1
4-
fi
5-
RESULT=`awk 'BEGIN {RS=""} NR==1{print $0}' "$FILENAME" | ./a.out`
6-
ANSWER=`awk 'BEGIN {RS=""} NR==2{print $0}' "$FILENAME"`
7-
echo "result:"
8-
echo "$RESULT"
9-
echo ""
10-
echo "answer:"
11-
echo "$ANSWER"
1+
TEST=`cat "$1.in" | ./a.out`
2+
3+
echo $TEST | diff "$1.out" -

0 commit comments

Comments
 (0)