Almost fix extra_coverage test

This commit is contained in:
Scott Shawcroft 2023-10-05 17:03:42 -07:00
parent 22a44c6003
commit 2910dea6fd
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
10 changed files with 30 additions and 29 deletions

2
.gitmodules vendored
View File

@ -293,7 +293,7 @@
url = https://github.com/adafruit/Adafruit_CircuitPython_Ticks.git url = https://github.com/adafruit/Adafruit_CircuitPython_Ticks.git
[submodule "frozen/Adafruit_CircuitPython_asyncio"] [submodule "frozen/Adafruit_CircuitPython_asyncio"]
path = frozen/Adafruit_CircuitPython_asyncio path = frozen/Adafruit_CircuitPython_asyncio
url = https://github.com/adafruit/Adafruit_CircuitPython_asyncio.git url = https://github.com/tannewt/Adafruit_CircuitPython_asyncio.git
[submodule "frozen/circuitpython_ef_music"] [submodule "frozen/circuitpython_ef_music"]
path = frozen/circuitpython_ef_music path = frozen/circuitpython_ef_music
url = https://github.com/elecfreaks/circuitpython_ef_music.git url = https://github.com/elecfreaks/circuitpython_ef_music.git

@ -1 +1 @@
Subproject commit 7c25d09be04a2979bcfb43b801de57594112808d Subproject commit 6198266ecaeb1c8486a1333ee7c18bd5678d830a

View File

@ -89,7 +89,7 @@ static void usb_serial_jtag_isr_handler(void *arg) {
} }
void usb_serial_jtag_init(void) { void usb_serial_jtag_init(void) {
ringbuf_init(&ringbuf, buf, sizeof(buf) - 1); ringbuf_init(&ringbuf, buf, sizeof(buf));
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1); usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1);
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1); usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1);
ESP_ERROR_CHECK(esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, ESP_INTR_FLAG_LEVEL1, ESP_ERROR_CHECK(esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, ESP_INTR_FLAG_LEVEL1,

View File

@ -612,8 +612,11 @@ STATIC mp_obj_t extra_coverage(void) {
// ringbuf // ringbuf
{ {
byte buf[100]; #define RINGBUF_SIZE 99
ringbuf_t ringbuf = {buf, sizeof(buf), 0, 0, 0};
byte buf[RINGBUF_SIZE];
ringbuf_t ringbuf;
ringbuf_init(&ringbuf, buf, sizeof(buf));
mp_printf(&mp_plat_print, "# ringbuf\n"); mp_printf(&mp_plat_print, "# ringbuf\n");
@ -631,7 +634,7 @@ STATIC mp_obj_t extra_coverage(void) {
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf)); mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
// Two-byte put with full ringbuf. // Two-byte put with full ringbuf.
for (int i = 0; i < 99; ++i) { for (int i = 0; i < RINGBUF_SIZE; ++i) {
ringbuf_put(&ringbuf, i); ringbuf_put(&ringbuf, i);
} }
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf)); mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
@ -643,7 +646,7 @@ STATIC mp_obj_t extra_coverage(void) {
ringbuf_get(&ringbuf); ringbuf_get(&ringbuf);
mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf)); mp_printf(&mp_plat_print, "%d %d\n", ringbuf_num_empty(&ringbuf), ringbuf_num_filled(&ringbuf));
mp_printf(&mp_plat_print, "%d\n", ringbuf_put16(&ringbuf, 0xcc99)); mp_printf(&mp_plat_print, "%d\n", ringbuf_put16(&ringbuf, 0xcc99));
for (int i = 0; i < 97; ++i) { for (int i = 0; i < RINGBUF_SIZE - 2; ++i) {
ringbuf_get(&ringbuf); ringbuf_get(&ringbuf);
} }
mp_printf(&mp_plat_print, "%04x\n", ringbuf_get16(&ringbuf)); mp_printf(&mp_plat_print, "%04x\n", ringbuf_get16(&ringbuf));
@ -651,7 +654,7 @@ STATIC mp_obj_t extra_coverage(void) {
// Two-byte put with wrap around on first byte: // Two-byte put with wrap around on first byte:
ringbuf_clear(&ringbuf); ringbuf_clear(&ringbuf);
for (int i = 0; i < 99; ++i) { for (int i = 0; i < RINGBUF_SIZE; ++i) {
ringbuf_put(&ringbuf, i); ringbuf_put(&ringbuf, i);
ringbuf_get(&ringbuf); ringbuf_get(&ringbuf);
} }
@ -660,7 +663,7 @@ STATIC mp_obj_t extra_coverage(void) {
// Two-byte put with wrap around on second byte: // Two-byte put with wrap around on second byte:
ringbuf_clear(&ringbuf); ringbuf_clear(&ringbuf);
for (int i = 0; i < 98; ++i) { for (int i = 0; i < RINGBUF_SIZE - 1; ++i) {
ringbuf_put(&ringbuf, i); ringbuf_put(&ringbuf, i);
ringbuf_get(&ringbuf); ringbuf_get(&ringbuf);
} }

View File

@ -28,7 +28,6 @@ def get_version_info_from_git(repo_path):
# Note: git describe doesn't work if no tag is available # Note: git describe doesn't work if no tag is available
try: try:
print(tools_describe)
git_tag = subprocess.check_output( git_tag = subprocess.check_output(
[tools_describe], [tools_describe],
cwd=repo_path, cwd=repo_path,
@ -95,10 +94,8 @@ def make_version_header(repo_path, filename):
# Get version info using git (required) # Get version info using git (required)
info = get_version_info_from_git(repo_path) info = get_version_info_from_git(repo_path)
if info is None: if info is None:
print(info)
cannot_determine_version() cannot_determine_version()
git_tag, git_hash, ver = info git_tag, git_hash, ver = info
print(git_tag, git_hash, ver)
if len(ver) < 3: if len(ver) < 3:
cannot_determine_version() cannot_determine_version()
else: else:

View File

@ -318,7 +318,7 @@ void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t cons
} }
void usb_keyboard_init(void) { void usb_keyboard_init(void) {
ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1); ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf));
} }
bool usb_keyboard_chars_available(void) { bool usb_keyboard_chars_available(void) {

View File

@ -59,7 +59,7 @@ static _websocket cp_serial;
void websocket_init(void) { void websocket_init(void) {
socketpool_socket_reset(&cp_serial.socket); socketpool_socket_reset(&cp_serial.socket);
ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1); ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf));
} }
void websocket_handoff(socketpool_socket_obj_t *socket) { void websocket_handoff(socketpool_socket_obj_t *socket) {

BIN
tests/frozen/frozentest.mpy Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
print("uPy")
print("a long string that is not interned")
print("a string that has unicode αβγ chars")
print(b"bytes 1234\x01")
print(123456789)
for i in range(4):
print(i)

View File

@ -15,12 +15,12 @@ false true
abc abc
% %
# GC # GC
0 0x0
0 0x0
# GC part 2 # GC part 2
pass pass
# tracked allocation # tracked allocation
m_tracked_head = 0 m_tracked_head = 0x0
0 1 0 1
1 1 1 1
2 1 2 1
@ -37,7 +37,7 @@ m_tracked_head = 0
5 1 5 1
6 1 6 1
7 1 7 1
m_tracked_head = 0 m_tracked_head = 0x0
# vstr # vstr
tests tests
sts sts
@ -55,19 +55,13 @@ _uasyncio aesio array audiocore
audiomixer bitmaptools cexample cmath audiomixer bitmaptools cexample cmath
collections cppexample displayio gc collections cppexample displayio gc
math qrio rainbowio struct math qrio rainbowio struct
synthio termios traceback ubinascii synthio traceback ubinascii uctypes
uctypes uerrno uhashlib uheapq uerrno uhashlib uheapq uio
uio ujson ulab ulab.numpy ujson ulab uos uplatform
ulab.numpy.fft ulab.numpy.linalg ulab.scipy urandom ure uselect usys
ulab.scipy.linalg ulab.scipy.optimize utime uzlib zlib
ulab.scipy.signal ulab.scipy.special
ulab.utils uos urandom ure
uselect usys utime utimeq
uzlib zlib
ime ime
utime utimeq
argv atexit byteorder exc_info argv atexit byteorder exc_info
executable exit getsizeof implementation executable exit getsizeof implementation
maxsize modules path platform maxsize modules path platform