From: Vincent Sanders Date: Wed, 2 Sep 2015 08:21:05 +0000 (+0100) Subject: enable decode tests for svg files X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=fe31edd04e7789b8e6050729809d6b76fc42dd3d;p=libsvgtiny.git enable decode tests for svg files These svg files have caused the library to crash and to render poorly. --- diff --git a/Makefile b/Makefile index 308e7d0..e9af281 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,8 @@ PREFIX ?= /opt/netsurf NSSHARED ?= $(PREFIX)/share/netsurf-buildsystem include $(NSSHARED)/makefiles/Makefile.tools -TESTRUNNER := $(ECHO) +# Reevaluate when used, as BUILDDIR won't be defined yet +TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT) # Toolchain flags WARNFLAGS := -Wall -W -Wundef -Wpointer-arith -Wcast-align \ diff --git a/svgtiny_display b/examples/svgtiny_display similarity index 100% rename from svgtiny_display rename to examples/svgtiny_display diff --git a/test/Makefile b/test/Makefile index 84a0cbe..49fb64d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,4 +1,4 @@ # Tests -DIR_TEST_ITEMS := svgtiny_test:svgtiny_test.c +DIR_TEST_ITEMS := decode_svg:decode_svg.c include $(NSBUILD)/Makefile.subdir diff --git a/test/data/excess-params.svg b/test/data/excess-params.svg new file mode 100644 index 0000000..86f97c2 --- /dev/null +++ b/test/data/excess-params.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/data/range.svg b/test/data/range.svg new file mode 100644 index 0000000..7661ddb --- /dev/null +++ b/test/data/range.svg @@ -0,0 +1,2 @@ + +Range25%50%75%100%44% diff --git a/test/data/social.svg b/test/data/social.svg new file mode 100644 index 0000000..3fe79ca --- /dev/null +++ b/test/data/social.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/data/sprite.svg b/test/data/sprite.svg new file mode 100644 index 0000000..c5d1fab --- /dev/null +++ b/test/data/sprite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/tiger.svg b/test/data/tiger.svg similarity index 100% rename from examples/tiger.svg rename to test/data/tiger.svg diff --git a/test/svgtiny_test.c b/test/decode_svg.c similarity index 100% rename from test/svgtiny_test.c rename to test/decode_svg.c diff --git a/test/runtest.sh b/test/runtest.sh new file mode 100755 index 0000000..f1c33ea --- /dev/null +++ b/test/runtest.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +TEST_PATH=$1 +TEST_OUT=${TEST_PATH}/svg + +mkdir -p ${TEST_OUT} + +svgdecode() +{ + OUTF=$(basename ${1} .svg) + ${TEST_PATH}/test_decode_svg ${1} > ${TEST_OUT}/${OUTF}.svg +} + + +for SVG in $(ls test/data/*.svg);do + svgdecode ${SVG} +done +