File: backend-base

package info (click to toggle)
matplotlib 2.0.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 91,640 kB
  • ctags: 29,525
  • sloc: python: 122,697; cpp: 60,806; ansic: 30,799; objc: 2,830; makefile: 224; sh: 85
file content (37 lines) | stat: -rwxr-xr-x 689 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
set -efu

DEBUG=${DEBUG:-yes}

export HOME=$ADTTMP
cd $ADTTMP

echo "=== $BACKEND ==="

cat << EOF > test.py
# https://github.com/matplotlib/matplotlib/issues/3505
import sys
sys.ps1 = 'SOMETHING'
import matplotlib
matplotlib.use("$BACKEND")
import matplotlib.pyplot as plt

plt.ion()
plt.plot(range(5), range(5))
plt.show()
plt.gca().figure.canvas.draw()
plt.savefig('test.png')
EOF

for py in $pys; do
    echo "=== $py ==="
    xvfb-run -a -s "-screen 0 1280x1024x24 -noreset" $py test.py
    rm test.png

    if [ "$DEBUG" = "yes" ]; then
      echo "=== $py-dbg ==="
      xvfb-run -a -s "-screen 0 1280x1024x24 -noreset" $py-dbg test.py 2>&1
      rm test.png
    fi
done