Debian Codegraph @

debian/tests/run-unit-test

raw symbols SCIP
1 #!/bin/bash
2
3 export LC_ALL=C.UTF-8
4 if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
5 AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
6 trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
7 fi
8
9 cd "$AUTOPKGTEST_TMP"
10
11 # Sample test script to create svg
12 cat >test.py <<HERE
13 from railroad import Diagram, Optional, Choice, NonTerminal
14 d = Diagram(
15 Optional('+', 'skip'),
16 Choice(0,
17 NonTerminal('name-start char'),
18 NonTerminal('escape')))
19 f = open('test.svg', 'w+')
20 d.writeSvg(f.write)
21 f.close()
22 HERE
23
24 # Run tests in all supported versions of Python
25 for py in $(py3versions --supported); do
26 ${py} ./test.py
27
28 # Ensure file is actually svg
29 file test.svg | fgrep -q 'SVG'
30
31 # Convert to png and test
32 rsvg-convert -o test.png test.svg
33
34 file test.png | fgrep -q 'PNG'
35 done