]>
gitweb.michael.orlitzky.com - libsvgtiny.git/blob - test/runtest.sh
3 # run test images through libnssvg and count results
4 # This file is part of libsvgtiny
6 # Licensed under the MIT License,
7 # http://opensource.org/licenses/mit-license.php
8 # Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
11 TEST_OUT
=${TEST_PATH}/mvg
12 TEST_LOG
=${TEST_PATH}/test.log
16 echo "SVG tests" > ${TEST_LOG}
18 # svg test directories
21 SVGTESTS
="test/data/*.svg"
23 # netsurf afl generated svg suite
24 SVGTESTS
="${SVGTESTS} test/ns-afl-svg/*.svg"
28 OUTF
=$(basename ${1} .svg)
29 CMPF
=$(dirname ${1})/${OUTF}.mvg
30 echo "SVG:${1}" >> ${TEST_LOG}
31 ${TEST_PATH}/test_decode_svg
${1} 1.0 ${TEST_OUT}/${OUTF}.mvg
2>> ${TEST_LOG}
34 echo "Exit code:${ECODE}" >> ${TEST_LOG}
35 if [ "${ECODE}" -gt 0 ];then
39 if [ -f "${CMPF}" ]; then
40 cmp ${CMPF} ${TEST_OUT}/${OUTF}.ppm
>> ${TEST_LOG} 2>> ${TEST_LOG}
41 if [ "$?" -ne 0 ]; then
46 #convert mvg:${TEST_OUT}/${OUTF}.mvg png:${TEST_OUT}/${OUTF}.png
56 echo "Testing SVG decode"
58 for SVG
in $(ls ${SVGTESTS});do
59 SVGTESTTOTC
=$((SVGTESTTOTC+1))
62 if [ "${ECODE}" -gt 127 ];then
63 SVGTESTERRC
=$((SVGTESTERRC+1))
65 if [ "${ECODE}" -gt 0 ];then
66 SVGTESTFAILC
=$((SVGTESTFAILC+1))
68 SVGTESTPASSC
=$((SVGTESTPASSC+1))
73 echo "Tests:${SVGTESTTOTC} Pass:${SVGTESTPASSC} Fail:${SVGTESTFAILC} Error:${SVGTESTERRC}"
76 if [ "${SVGTESTFAILC}" -gt 0 ]; then
79 if [ "${SVGTESTERRC}" -gt 0 ]; then