Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0fbdd57
tests/extmod/machine_spi_rate.py: Support samd with default SPI.
dpgeorge Jul 29, 2025
f8efe44
tests/extmod: Support ESP32-C3 targets.
dpgeorge Jul 29, 2025
2e3e758
tests/extmod/machine_spi_rate.py: Use default pins on ESP32.
dpgeorge Jul 29, 2025
99a9155
tests/run-perfbench.py: Skip bm_hexiom on small targets.
dpgeorge Jul 31, 2025
2c1fe8e
tests/net_inet: Skip tests on axTLS when necessary.
dpgeorge Jul 31, 2025
a2476c1
tests/perf_bench: Skip tests when vfs doesn't exist.
dpgeorge Jul 31, 2025
f78b65c
tests/float/string_format_modulo2_intbig.py: Get working on esp8266.
dpgeorge Jul 31, 2025
c5d0dd2
tests/extmod/vfs_blockdev_invalid.py: Skip if no RAM to mkfs.
dpgeorge Jul 31, 2025
2c7f8a5
tests/net_hosted/ssl_verify_callback.py: Skip if necessary.
dpgeorge Jul 31, 2025
8158596
py/persistentcode: Only select hard-fp arch if compiler uses hard ABI.
dpgeorge Jul 31, 2025
14329f4
tests/run-perfbench.py: Skip tests that have a MemoryError.
dpgeorge Jul 31, 2025
2f4f18f
tests/run-tests.py: Skip various tests on small SAMD targets.
dpgeorge Jul 31, 2025
697c68b
tests/multi_net: Skip tests on axTLS when needed.
dpgeorge Aug 4, 2025
b2e3761
tests/multi_net/udp_data_multi.py: Reduce number of UDP groups.
dpgeorge Aug 5, 2025
9d7ebcc
tests/run-perfbench.py: Skip misc_mandel if target doesn't have complex.
dpgeorge Aug 5, 2025
430ae9f
esp32/modules: Convert AttributeError to ImportError.
dpgeorge Aug 5, 2025
a545264
tests/ports/stm32/adcall.py: Print values if test ADC fails.
dpgeorge Aug 6, 2025
9e4e073
tests/extmod/machine_spi_rate.py: Support mimxrt and nrf ports.
dpgeorge Aug 10, 2025
dbfeb32
tests/run-tests.py: Abort test if serial port fails at start.
dpgeorge Aug 11, 2025
863dfd5
tests/run-tests.py: Abort test run if enter_raw_repl fails many times.
dpgeorge Aug 14, 2025
ff9f6f9
esp8266/boards: Include unittest in 512k board variant.
dpgeorge Aug 13, 2025
81ef984
tests/run-natmodtests.py: Abort test run if target fails.
dpgeorge Aug 15, 2025
15de2a3
tests: Move esp32-specific test to general test dir.
dpgeorge Aug 16, 2025
e8e39d7
tests/net_inet/resolve_on_connect.py: Convert to use unittest.
dpgeorge Aug 16, 2025
8644b7b
tests/ports/esp32/check_err_str.py: Open file in root directory.
dpgeorge Aug 17, 2025
d31ac07
tests/misc/rge_sm.py: Use list.append instead of list += [...].
dpgeorge Aug 17, 2025
8d04fae
py/objlist: Make list append allocation more gentle.
dpgeorge Aug 17, 2025
38c8e0b
tests/run-tests.py: Auto detect -march-flags for mpy-cross.
dpgeorge Sep 22, 2025
60adac5
tests/run-tests.py: Allow port:<dev> specification in run-multitests.py.
dpgeorge Sep 23, 2025
64c8c24
tests/extmod/time_res.py: Properly skip functions not in time module.
dpgeorge Sep 26, 2025
347e8e1
tests/net_inet: Update micropython.org certificate for SSL tests.
dpgeorge Sep 26, 2025
98fddbc
tests/extmod/machine_soft_timer.py: Skip on nrf boards.
dpgeorge Sep 26, 2025
62f5dcf
tests/micropython/ringio_big.py: Print results at end of test.
dpgeorge Sep 26, 2025
3e00073
proposal: run-multitests.py --target-wiring
hmaerki Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ports/esp32/modules/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,7 @@ def phases(self):

# Delegate to built-in machine module.
def __getattr__(attr):
return getattr(_machine, attr)
value = getattr(_machine, attr, None)
if value is None:
raise ImportError(attr)
return value
17 changes: 9 additions & 8 deletions ports/esp8266/boards/ESP8266_GENERIC/manifest_512kiB.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module("_boot.py", opt=3)
module("apa102.py", base_path="$(PORT_DIR)/modules", opt=3)
module("port_diag.py", base_path="$(PORT_DIR)/modules", opt=3)
require("ntptime")
require("dht")
require("onewire")
require("ds18x20")
require("webrepl")
require("neopixel")
# module("apa102.py", base_path="$(PORT_DIR)/modules", opt=3)
# module("port_diag.py", base_path="$(PORT_DIR)/modules", opt=3)
# require("ntptime")
# require("dht")
# require("onewire")
# require("ds18x20")
# require("webrepl")
# require("neopixel")
require("unittest")
6 changes: 4 additions & 2 deletions py/objlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@ mp_obj_t mp_obj_list_append(mp_obj_t self_in, mp_obj_t arg) {
mp_check_self(mp_obj_is_type(self_in, &mp_type_list));
mp_obj_list_t *self = MP_OBJ_TO_PTR(self_in);
if (self->len >= self->alloc) {
self->items = m_renew(mp_obj_t, self->items, self->alloc, self->alloc * 2);
self->alloc *= 2;
// Progression: 4 8 12 20 32 48 72 108 164 248 372 ...
size_t new_alloc = (self->alloc + self->alloc / 2 + 3) & ~3;
self->items = m_renew(mp_obj_t, self->items, self->alloc, new_alloc);
self->alloc = new_alloc;
mp_seq_clear(self->items, self->len + 1, self->alloc, sizeof(*self->items));
}
self->items[self->len++] = arg;
Expand Down
4 changes: 2 additions & 2 deletions py/persistentcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_X64)
#elif MICROPY_EMIT_THUMB
#if defined(__thumb2__)
#if defined(__ARM_FP) && (__ARM_FP & 8) == 8
#if defined(__ARM_FP) && (__ARM_FP & 8) == 8 && defined(__ARM_PCS_VFP)
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EMDP)
#elif defined(__ARM_FP) && (__ARM_FP & 4) == 4
#elif defined(__ARM_FP) && (__ARM_FP & 4) == 4 && defined(__ARM_PCS_VFP)
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EMSP)
#else
#define MPY_FEATURE_ARCH (MP_NATIVE_ARCH_ARMV7EM)
Expand Down
5 changes: 4 additions & 1 deletion tests/extmod/machine_i2s_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
(2, Pin("D4"), Pin("D3"), Pin("D2"), None),
)
elif "esp32" in sys.platform:
i2s_instances = ((0, Pin(18), Pin(19), Pin(21), Pin(14)),)
if "ESP32C3" in sys.implementation._machine or "ESP32-C3" in sys.implementation._machine:
i2s_instances = ((0, Pin(5), Pin(6), Pin(7), Pin(4)),)
else:
i2s_instances = ((0, Pin(18), Pin(19), Pin(21), Pin(14)),)
# Allow for small additional RTOS overhead
MAX_DELTA_MS = 8

Expand Down
2 changes: 1 addition & 1 deletion tests/extmod/machine_soft_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys


if sys.platform in ("esp32", "esp8266"):
if sys.platform in ("esp32", "esp8266", "nrf"):
print("SKIP") # TODO: Implement soft timers for esp32/esp8266 ports
raise SystemExit

Expand Down
19 changes: 15 additions & 4 deletions tests/extmod/machine_spi_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
if "alif" in sys.platform:
MAX_DELTA_MS = 20
spi_instances = ((0, None, None, None),)
elif "samd" in sys.platform:
# Use default SPI instance (tested working on ADAFRUIT_ITSYBITSY_M0_EXPRESS).
spi_instances = ((None, None, None, None),)
elif "pyboard" in sys.platform:
spi_instances = (
(1, None, None, None), # "explicit choice of sck/mosi/miso is not implemented"
Expand All @@ -25,13 +28,19 @@
spi_instances = ((0, Pin(18), Pin(19), Pin(16)),)
elif "esp32" in sys.platform:
impl = str(sys.implementation)
if any(soc in impl for soc in ("ESP32C2", "ESP32C3", "ESP32C6")):
spi_instances = ((1, Pin(4), Pin(5), Pin(6)),)
if any(soc in impl for soc in ("ESP32C2", "ESP32C3", "ESP32-C3", "ESP32C6")):
spi_instances = ((1, None, None, None),)
else:
spi_instances = ((1, Pin(18), Pin(19), Pin(21)), (2, Pin(18), Pin(19), Pin(21)))
spi_instances = ((1, None, None, None), (2, None, None, None))
elif "esp8266" in sys.platform:
MAX_DELTA_MS = 50 # port requires much looser timing requirements
spi_instances = ((1, None, None, None),) # explicit pin choice not allowed
elif "mimxrt" in sys.platform:
# Use default SPI instance (tested working on TEENSY40).
spi_instances = ((None, None, None, None),)
elif "nrf" in sys.platform:
# Tested working on ARDUINO_NANO_33_BLE_SENSE.
spi_instances = ((1, None, None, None),)
else:
print("Please add support for this test on this platform.")
raise SystemExit
Expand Down Expand Up @@ -111,8 +120,10 @@ def test_spi(spi_id, sck, mosi, miso, baudrate, polarity, phase, print_results):
polarity=polarity,
phase=phase,
)
else:
elif spi_id is not None:
s = SPI(spi_id, baudrate=baudrate, polarity=polarity, phase=phase)
else:
s = SPI(baudrate=baudrate, polarity=polarity, phase=phase)

# to keep the test runtime down, use shorter buffer for lower baud rate
wr_buf = wr_long if baudrate > 500_000 else wr_short
Expand Down
7 changes: 5 additions & 2 deletions tests/extmod/time_res.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ def test():
time.sleep_ms(100)
for func_name, _ in EXPECTED_MAP:
try:
time_func = getattr(time, func_name, None) or globals()[func_name]
if func_name.endswith("_time"):
time_func = globals()[func_name]
else:
time_func = getattr(time, func_name)
now = time_func() # may raise AttributeError
except (KeyError, AttributeError):
except AttributeError:
continue
try:
results_map[func_name].add(now)
Expand Down
2 changes: 2 additions & 0 deletions tests/extmod/vfs_blockdev_invalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def ioctl(self, op, arg):

try:
bdev = RAMBlockDevice(50)
vfs.VfsLfs2.mkfs(bdev)
vfs.VfsFat.mkfs(bdev)
except MemoryError:
print("SKIP")
raise SystemExit
Expand Down
20 changes: 17 additions & 3 deletions tests/float/string_format_modulo2_intbig.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# test formatting floats with large precision, that it doesn't overflow the buffer

try:
import micropython
except:

class micropython:
def bytecode(f):
return f


def test(num, num_str):
if num == float("inf") or num == 0.0 and num_str != "0.0":
Expand All @@ -18,6 +26,12 @@ def test(num, num_str):


# check most powers of 10, making sure to include exponents with 3 digits
for e in range(-101, 102):
num = pow(10, e)
test(num, "1e%d" % e)
# force bytecode emitter so it can feed the WDT on esp8266
@micropython.bytecode
def main():
for e in range(-101, 102):
num = pow(10, e)
test(num, "1e%d" % e)


main()
8 changes: 6 additions & 2 deletions tests/micropython/ringio_big.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
print("SKIP")
raise SystemExit

result = []

try:
# The maximum possible size
micropython.RingIO(bytearray(65535))
Expand All @@ -17,13 +19,15 @@
# Buffer may not be too big
micropython.RingIO(bytearray(65536))
except ValueError as ex:
print(type(ex))
result.append(type(ex))

try:
# Size may not be too big
micropython.RingIO(65535)
except ValueError as ex:
print(type(ex))
result.append(type(ex))
except MemoryError:
print("SKIP")
raise SystemExit

print(result)
3 changes: 1 addition & 2 deletions tests/micropython/ringio_big.py.exp
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<class 'ValueError'>
<class 'ValueError'>
[<class 'ValueError'>, <class 'ValueError'>]
2 changes: 1 addition & 1 deletion tests/misc/rge_sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def iterate(self):
k = ktmp[:]
step = [s + c * k[ik] for ik, s in enumerate(step)]
if self.save:
self.Trajectory += [step]
self.Trajectory.append(step)
else:
self.Trajectory = [step]
return True
Expand Down
46 changes: 24 additions & 22 deletions tests/multi_extmod/machine_i2c_target_irq.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,34 @@
print("SKIP")
raise SystemExit

from target_wiring import i2c_args, i2c_kwargs

ADDR = 67
clock_stretch_us = 200

# Configure pins based on the target.
if sys.platform == "alif":
i2c_args = (1,) # pins P3_7/P3_6
i2c_kwargs = {}
elif sys.platform == "mimxrt":
i2c_args = (0,) # pins 19/18 on Teensy 4.x
i2c_kwargs = {}
clock_stretch_us = 50 # mimxrt cannot delay too long in the IRQ handler
elif sys.platform == "rp2":
i2c_args = (0,)
i2c_kwargs = {"scl": 9, "sda": 8}
elif sys.platform == "pyboard":
i2c_args = ("Y",)
i2c_kwargs = {}
elif sys.platform == "samd":
i2c_args = () # pins SCL/SDA
i2c_kwargs = {}
elif "zephyr-rpi_pico" in sys.implementation._machine:
i2c_args = ("i2c1",) # on gpio7/gpio6
i2c_kwargs = {}
else:
print("Please add support for this test on this platform.")
raise SystemExit
# if sys.platform == "alif":
# i2c_args = (1,) # pins P3_7/P3_6
# i2c_kwargs = {}
# elif sys.platform == "mimxrt":
# i2c_args = (0,) # pins 19/18 on Teensy 4.x
# i2c_kwargs = {}
# clock_stretch_us = 50 # mimxrt cannot delay too long in the IRQ handler
# elif sys.platform == "rp2":
# i2c_args = (0,)
# i2c_kwargs = {"scl": 9, "sda": 8}
# elif sys.platform == "pyboard":
# i2c_args = ("Y",)
# i2c_kwargs = {}
# elif sys.platform == "samd":
# i2c_args = () # pins SCL/SDA
# i2c_kwargs = {}
# elif "zephyr-rpi_pico" in sys.implementation._machine:
# i2c_args = ("i2c1",) # on gpio7/gpio6
# i2c_kwargs = {}
# else:
# print("Please add support for this test on this platform.")
# raise SystemExit


def simple_irq(i2c_target):
Expand Down
52 changes: 27 additions & 25 deletions tests/multi_extmod/machine_i2c_target_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,35 @@
import sys
from machine import I2C, I2CTarget

from target_wiring import i2c_args, i2c_kwargs

ADDR = 67

# Configure pins based on the target.
if sys.platform == "alif":
i2c_args = (1,) # pins P3_7/P3_6
i2c_kwargs = {}
elif sys.platform == "esp32":
i2c_args = (1,) # on pins 9/8
i2c_kwargs = {}
elif sys.platform == "mimxrt":
i2c_args = (0,) # pins 19/18 on Teensy 4.x
i2c_kwargs = {}
elif sys.platform == "rp2":
i2c_args = (0,)
i2c_kwargs = {"scl": 9, "sda": 8}
elif sys.platform == "pyboard":
i2c_args = ("Y",)
i2c_kwargs = {}
elif sys.platform == "samd":
i2c_args = () # pins SCL/SDA
i2c_kwargs = {}
elif "zephyr-rpi_pico" in sys.implementation._machine:
i2c_args = ("i2c1",) # on gpio7/gpio6
i2c_kwargs = {}
else:
print("Please add support for this test on this platform.")
raise SystemExit
# # Configure pins based on the target.
# if sys.platform == "alif":
# i2c_args = (1,) # pins P3_7/P3_6
# i2c_kwargs = {}
# elif sys.platform == "esp32":
# i2c_args = (1,) # on pins 9/8
# i2c_kwargs = {}
# elif sys.platform == "mimxrt":
# i2c_args = (0,) # pins 19/18 on Teensy 4.x
# i2c_kwargs = {}
# elif sys.platform == "rp2":
# i2c_args = (0,)
# i2c_kwargs = {"scl": 9, "sda": 8}
# elif sys.platform == "pyboard":
# i2c_args = ("Y",)
# i2c_kwargs = {}
# elif sys.platform == "samd":
# i2c_args = () # pins SCL/SDA
# i2c_kwargs = {}
# elif "zephyr-rpi_pico" in sys.implementation._machine:
# i2c_args = ("i2c1",) # on gpio7/gpio6
# i2c_kwargs = {}
# else:
# print("Please add support for this test on this platform.")
# raise SystemExit


def simple_irq(i2c_target):
Expand Down
3 changes: 3 additions & 0 deletions tests/multi_net/asyncio_tls_server_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,8 @@ def instance0():


def instance1():
if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit
multitest.next()
asyncio.run(tcp_client(b"client data"))
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
print("SKIP")
raise SystemExit

if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit

PORT = 8000

# These are test certificates. See tests/README.md for details.
Expand Down
3 changes: 3 additions & 0 deletions tests/multi_net/asyncio_tls_server_client_readline.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@ def instance0():


def instance1():
if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit
multitest.next()
asyncio.run(tcp_client(b"client data\nclient data2\n"))
3 changes: 3 additions & 0 deletions tests/multi_net/asyncio_tls_server_client_verify_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@ def instance0():


def instance1():
if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit
multitest.next()
asyncio.run(tcp_client(b"client data"))
3 changes: 3 additions & 0 deletions tests/multi_net/ssl_cert_ec.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def instance0():

# Client
def instance1():
if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit
multitest.next()
s = socket.socket()
s.connect(socket.getaddrinfo(IP, PORT)[0][-1])
Expand Down
3 changes: 3 additions & 0 deletions tests/multi_net/ssl_cert_rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def instance0():

# Client
def instance1():
if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit
multitest.next()
s = socket.socket()
s.connect(socket.getaddrinfo(IP, PORT)[0][-1])
Expand Down
3 changes: 3 additions & 0 deletions tests/multi_net/sslcontext_check_hostname_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def instance0():

# Client
def instance1():
if not hasattr(ssl, "CERT_REQUIRED"):
print("SKIP")
raise SystemExit
multitest.next()
s = socket.socket()
s.connect(socket.getaddrinfo(IP, PORT)[0][-1])
Expand Down
Loading