]> gitweb.michael.orlitzky.com - libsvgtiny-pixbuf.git/blob - run-tests.sh
COPYING: add one to state the "or later" bit
[libsvgtiny-pixbuf.git] / run-tests.sh
1 #!/bin/sh
2 #
3 # Run svg2png on a few carefully chosen cases to ensure that it
4 # doesn't segfault. The $test_cases variable is set by automake. We
5 # have to override some bits of gdk-pixbuf to ensure that the
6 # newly-build libsvgtiny-pixbuf is used, and not the installed copy --
7 # or worse, an installed copy of librsvg.
8 set -e
9
10 LOADERS_CACHE=$(pwd)/loaders.cache
11
12 # I'm not real happy about hard-coding the name ".libs", but it works
13 # for now (we need the directory where the just-built *.so file
14 # lives).
15 GDK_PIXBUF_MODULEDIR=.libs gdk-pixbuf-query-loaders > "${LOADERS_CACHE}"
16 export GDK_PIXBUF_MODULE_FILE="${LOADERS_CACHE}"
17
18 # Support running the test suite outside of automake
19 test -z "${test_cases}" && test_cases=test-cases
20
21 TEST_CASES=$(find ${test_cases} -type f -name '*.svg')
22 for f in $TEST_CASES; do
23 g="$(basename "${f}").png"
24 echo "Converting ${f} to ${g}..."
25 ./svg2png "${f}" "${g}"
26 echo "Success."
27 rm "${g}"
28 done
29
30 rm "${LOADERS_CACHE}"