7 OUTPUT
=.test-output.txt
16 total
=`expr $total + 1`
17 test_num
=`printf %03d $total`
20 printf "Run test $test_num: ${test_dsc}... " |
tee -a $LOGFILE
22 echo "Command: $test_cmd" >> $LOGFILE
23 eval "$test_cmd" > "$OUTPUT" 2>> $LOGFILE
24 cmp "$OUTPUT" "tests/res${test_num}.txt" >> $LOGFILE 2>&1
26 echo "pass" |
tee -a $LOGFILE
28 echo "**fail**" |
tee -a $LOGFILE
38 file="$TESTDIR/input.txt"
41 printf "Default font dir: "; $CMD -I2
42 if [ -n "$FONTDIR" ]; then
43 FIGLET_FONTDIR
="$FONTDIR"
46 printf "Current font dir: "; $CMD -I2
47 printf "Default font: "; $CMD -I3
48 $CMD -f small
"Test results" |
tee -a $LOGFILE
52 run_test
"showfigfonts output" "./showfigfonts"
53 run_test
"text rendering in all fonts" \
54 "for i in fonts/*.flf; do $cmd -f \$i; done"
55 run_test
"long text rendering" "cat tests/longtext.txt|$CMD"
56 run_test
"left-to-right text" "$cmd -L"
57 run_test
"right-to-left text" "$cmd -R"
58 run_test
"flush-left justification" "$cmd -l"
59 run_test
"flush-right justification" "$cmd -r"
60 run_test
"center justification" "$cmd -c"
61 run_test
"kerning mode" "$cmd -k"
62 run_test
"full width mode" "$cmd -W"
63 run_test
"overlap mode" "$cmd -o"
64 run_test
"tlf2 font rendering" "$cmd -f tests/emboss"
65 run_test
"kerning flush-left right-to-left mode" "$cmd -klR"
66 run_test
"kerning centered right-to-left mode (slant)" "$cmd -kcR -f slant"
67 run_test
"full-width flush-right right-to-left mode" "$cmd -WrR"
68 run_test
"overlap flush-right mode (big)" "$cmd -or -f big"
69 run_test
"tlf2 kerning flush-right mode" "$cmd -kr -f tests/emboss"
70 run_test
"tlf2 overlap centered mode" "$cmd -oc -f tests/emboss"
71 run_test
"tlf2 full-width flush-left right-to-left mode" \
72 "$cmd -WRl -f tests/emboss"
73 run_test
"specify font directory" \
74 "X=.t;mkdir \$X;cp fonts/script.flf \$X/foo.flf;$cmd -d\$X -ffoo;rm -Rf \$X"
75 run_test
"paragraph mode long line output" "$cmd -p -w250"
76 run_test
"short line output" "$cmd -w5"
77 run_test
"kerning paragraph centered mode (small)" "$cmd -kpc -fsmall"
78 run_test
"list of control files" "ls fonts/*flc"
79 run_test
"uskata control file" "printf 'ABCDE'|$CMD -fbanner -Cuskata"
80 run_test
"jis0201 control file" "printf '\261\262\263\264\265'|$CMD -fbanner -Cjis0201"
81 run_test
"right-to-left smushing with JavE font" "$cmd -f tests/flowerpower -R"
86 if [ $result -ne 0 ]; then
87 echo " $fail tests failed. See $LOGFILE for result details"
89 echo " All tests passed."