]> gitweb.michael.orlitzky.com - libsvgtiny-pixbuf.git/blob - run-tests.sh
Makefile.am,run-tests.sh: new bare-bones test suite
[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 TEST_CASES=$(find ${test_cases} -type f -name '*.svg')
19 for f in $TEST_CASES; do
20 g="$(basename "${f}").png"
21 echo "Converting ${f} to ${g}..."
22 ./svg2png "${f}" "${g}"
23 echo "Success."
24 rm "${g}"
25 done
26
27 rm "${LOADERS_CACHE}"