Skip to content

Commit f9393c9

Browse files
committed
enable qrio in unix coverage build, and add a test
1 parent 131dbf1 commit f9393c9

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

ports/unix/variants/coverage/mpconfigvariant.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,12 @@ MICROPY_VFS_LFS2 = 1
2121
FROZEN_DIR=variants/coverage/frzstr
2222
FROZEN_MPY_DIR=variants/coverage/frzmpy
2323

24+
SRC_QRIO := $(patsubst ../../%,%,$(wildcard ../../shared-bindings/qrio/*.c ../../shared-module/qrio/*.c ../../lib/quirc/lib/*.c))
25+
$(info SRC_QRIO = $(SRC_QRIO))
26+
SRC_C += $(SRC_QRIO)
27+
28+
CFLAGS += -DCIRCUITPY_QRIO=1
29+
$(BUILD)/lib/quirc/lib/%.o: CFLAGS += -Wno-shadow -Wno-sign-compare -include shared-module/qrio/quirc_alloc.h
30+
2431
SRC_C += coverage.c
2532
SRC_CXX += coveragecpp.cpp

tests/extmod/data/qr.pgm

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.

tests/extmod/qrio.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
try:
2+
import qrio
3+
except:
4+
print("SKIP")
5+
raise SystemExit
6+
7+
loc = __file__.rsplit("/", 1)[0]
8+
with open(f"{loc}/data/qr.pgm") as f:
9+
content = f.read()[-320 * 240 :]
10+
11+
decoder = qrio.QRDecoder(320, 240)
12+
for r in decoder.decode(content):
13+
print(r)

tests/extmod/qrio.py.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
QRInfo(payload=b'https://adafru.it', data_type='iso_8859-2')

tests/unix/extra_coverage.py.exp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ mport
3232
builtins micropython _thread array
3333
btree cexample cmath collections
3434
cppexample ffi framebuf gc
35-
hashlib math sys termios
36-
ubinascii uctypes uerrno uheapq
37-
uio ujson ulab uos
38-
urandom ure uselect ustruct
39-
utime utimeq uzlib
35+
hashlib math qrio sys
36+
termios ubinascii uctypes uerrno
37+
uheapq uio ujson ulab
38+
uos urandom ure uselect
39+
ustruct utime utimeq uzlib
4040
ime
4141

4242
utime utimeq

0 commit comments

Comments
 (0)