8000 qemu-arm: Enable lots of extmods and enable tests for them. · davidgiven/micropython@b0a15aa · GitHub
[go: up one dir, main page]

Skip to content

Commit b0a15aa

Browse files
committed
qemu-arm: Enable lots of extmods and enable tests for them.
The qemu-arm port is used for testing of ARM Thumb architecture on a desktop so should have many features enabled.
1 parent 8298251 commit b0a15aa

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

qemu-arm/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,28 @@ SRC_C = \
4040
SRC_TEST_C = \
4141
test_main.c \
4242

43+
STM_SRC_C = $(addprefix stmhal/,\
44+
pybstdio.c \
45+
)
46+
4347
SRC_S = \
4448

4549
OBJ =
4650
OBJ += $(PY_O)
4751
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
4852
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
53+
OBJ += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
4954

5055
OBJ_TEST =
5156
OBJ_TEST += $(PY_O)
5257
OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_TEST_C:.c=.o))
5358
OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
59+
OBJ_TEST += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
5460
OBJ_TEST += $(BUILD)/tinytest.o
5561

62+
# List of sources for qstr extraction
63+
SRC_QSTR += $(SRC_C) $(SRC_TEST_C) $(STM_SRC_C)
64+
5665
all: run
5766

5867
run: $(BUILD)/firmware.elf

qemu-arm/memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// this is needed for extmod/crypto-algorithms/sha256.c
2+
#include <string.h>

qemu-arm/mpconfigport.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,18 @@
2020
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
2121
#define MICROPY_PY_BUILTINS_FROZENSET (1)
2222
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
23-
#define MICROPY_PY_IO (0)
23+
#define MICROPY_PY_IO (1)
2424
#define MICROPY_PY_SYS_EXIT (1)
2525
#define MICROPY_PY_SYS_MAXSIZE (1)
26+
#define MICROPY_PY_UERRNO (1)
27+
#define MICROPY_PY_UBINASCII (1)
28+
#define MICROPY_PY_URANDOM (1)
29+
#define MICROPY_PY_UCTYPES (1)
30+
#define MICROPY_PY_UZLIB (1)
31+
#define MICROPY_PY_UJSON (1)
32+
#define MICROPY_PY_URE (1)
33+
#define MICROPY_PY_UHEAPQ (1)
34+
#define MICROPY_PY_UHASHLIB (1)
2635
#define MICROPY_USE_INTERNAL_PRINTF (0)
2736

2837
// type definitions for the specific machine

qemu-arm/mphalport.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
// empty file
1+
#define mp_hal_stdin_rx_chr() (0)
2+
#define mp_hal_stdout_tx_strn_cooked(s, l) write(1, (s), (l))

tools/tinytest-codegen.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,15 @@ def script_to_map(t):
4646

4747
## XXX: may be we could have `--without <groups>` argument...
4848
# currently these tests are selected because they pass on qemu-arm
49-
test_dirs = ('basics', 'micropython', 'inlineasm') # 'float', 'import', 'io', 'misc')
50-
exclude_tests = ('inlineasm/asmfpaddsub.py', 'inlineasm/asmfpcmp.py', 'inlineasm/asmfpldrstr.py', 'inlineasm/asmfpmuldiv.py', 'inlineasm/asmfpsqrt.py',)
49+
test_dirs = ('basics', 'micropython', 'extmod', 'inlineasm') # 'float', 'import', 'io', 'misc')
50+
exclude_tests = (
51+
'inlineasm/asmfpaddsub.py', 'inlineasm/asmfpcmp.py', 'inlineasm/asmfpldrstr.py', 'inlineasm/asmfpmuldiv.py', 'inlineasm/asmfpsqrt.py',
52+
'extmod/time_ms_us.py',
53+
'extmod/ujson_dumps_float.py', 'extmod/ujson_loads_float.py',
54+
'extmod/uctypes_native_float.py', 'extmod/uctypes_le_float.py',
55+
'extmod/machine_pinbase.py', 'extmod/machine_pulse.py',
56+
'extmod/vfs_fat_ramdisk.py',
57+
)
5158

5259
output = []
5360

0 commit comments

Comments
 (0)
0