The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

fuzzsvg.py in scripts

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of scripts/fuzzsvg.py.
Update apt repos in travis
1 #!/usr/bin/python3 2 3 import subprocess 4 from os import path 5 6 from run import run 7 8 def fuzz_svg_import(): 9 fuzz_svg ('birdfont-test/inkscape.svg') 10 fuzz_svg ('birdfont-test/illustrator.svg') 11 12 def fuzz_svg (file): 13 run ("mkdir -p build/fuzz") 14 run ("mkdir -p build/fuzz/bugs") 15 run ("radamsa " + file + " > build/fuzz/a.svg") 16 17 cmd = "./birdfont-test.sh SVG build/fuzz/a.svg" 18 print('Running: ' + cmd) 19 process = subprocess.Popen (cmd, shell=True) 20 process.communicate()[0] 21 if not process.returncode == 0: 22 print("Error: " + cmd) 23 print("A bug was found.") 24 25 i = 0 26 while path.isfile ('build/bugs/a_' + str(i) + '.svg'): 27 i = i + 1 28 29 run ('mv build/fuzz/a.svg attic/fuzz/bugs/a_' + str(i) + '.svg') 30 31 run ("rm -f build/fuzz/a.svg") 32 33 while True: 34 fuzz_svg_import () 35