enable qrio in unix coverage build, and add a test

This commit is contained in:
Jeff Epler 2021-08-05 11:12:07 -05:00
parent 131dbf1e87
commit f9393c9e51
5 changed files with 31 additions and 5 deletions

View File

@ -21,5 +21,12 @@ MICROPY_VFS_LFS2 = 1
FROZEN_DIR=variants/coverage/frzstr FROZEN_DIR=variants/coverage/frzstr
FROZEN_MPY_DIR=variants/coverage/frzmpy FROZEN_MPY_DIR=variants/coverage/frzmpy
SRC_QRIO := $(patsubst ../../%,%,$(wildcard ../../shared-bindings/qrio/*.c ../../shared-module/qrio/*.c ../../lib/quirc/lib/*.c))
$(info SRC_QRIO = $(SRC_QRIO))
SRC_C += $(SRC_QRIO)
CFLAGS += -DCIRCUITPY_QRIO=1
$(BUILD)/lib/quirc/lib/%.o: CFLAGS += -Wno-shadow -Wno-sign-compare -include shared-module/qrio/quirc_alloc.h
SRC_C += coverage.c SRC_C += coverage.c
SRC_CXX += coveragecpp.cpp SRC_CXX += coveragecpp.cpp

5
tests/extmod/data/qr.pgm Normal file

File diff suppressed because one or more lines are too long

13
tests/extmod/qrio.py Normal file
View File

@ -0,0 +1,13 @@
try:
import qrio
except:
print("SKIP")
raise SystemExit
loc = __file__.rsplit("/", 1)[0]
with open(f"{loc}/data/qr.pgm") as f:
content = f.read()[-320 * 240 :]
decoder = qrio.QRDecoder(320, 240)
for r in decoder.decode(content):
print(r)

1
tests/extmod/qrio.py.exp Normal file
View File

@ -0,0 +1 @@
QRInfo(payload=b'https://adafru.it', data_type='iso_8859-2')

View File

@ -32,11 +32,11 @@ mport
builtins micropython _thread array builtins micropython _thread array
btree cexample cmath collections btree cexample cmath collections
cppexample ffi framebuf gc cppexample ffi framebuf gc
hashlib math sys termios hashlib math qrio sys
ubinascii uctypes uerrno uheapq termios ubinascii uctypes uerrno
uio ujson ulab uos uheapq uio ujson ulab
urandom ure uselect ustruct uos urandom ure uselect
utime utimeq uzlib ustruct utime utimeq uzlib
ime ime
utime utimeq utime utimeq