codegen: avoid defining test image in multiple places

This commit is contained in:
András Veres-Szentkirályi 2016-04-20 14:04:57 +02:00
parent c7fecff3e6
commit 5d38b3b52d
2 changed files with 5 additions and 4 deletions

View file

@ -113,6 +113,7 @@ def test():
from datetime import datetime
import struct
exe = './codegen-test-executable'
img_file = '320x256rgb.png'
if not path.exists('stb_image.h'):
from urllib import urlretrieve
urlretrieve('https://raw.githubusercontent.com/nothings/stb/master/stb_image.h', 'stb_image.h')
@ -127,10 +128,10 @@ def test():
gen_elapsed = datetime.now() - start
print ' - gengcc took', gen_elapsed
start = datetime.now()
gen = check_output([exe])
gen = check_output([exe, img_file])
native_elapsed = datetime.now() - start
print ' - native took', native_elapsed
img = Image.open("320x256rgb.png")
img = Image.open(img_file)
sstv = sstv_class(img, 44100, 16)
start = datetime.now()
try: