Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 2 deletions linux_unit_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ INCLUDES = -I. -I../unit_tests/main -I$(DEV_TYPE_GEN_DIR) -I$(ESPNOW_DIR) \
-I$(CORE)/DeviceManager -I$(CORE)/DeviceTypes -I$(CORE)/APICommon -I$(CORE)/FileSystem \
-I$(CORE)/RestAPIEndpoints -I$(CORE)/MiniHDLC -I$(CORE)/ThreadSafeQueue -I$(CORE)/SysManager \
-I$(CORE)/SysTypes -I$(CORE)/RingBuffer -I$(CORE)/MQTT -I$(CORE)/LEDPixels \
-I$(COMMS)/FileStreamProtocols -I$(COMMS)/ProtocolExchange -I$(COMMS)/ProtocolBase -I$(COMMS)/ProtocolRawMsg \
-I$(COMMS)/FileStreamProtocols -I$(COMMS)/ProtocolOverAscii -I$(COMMS)/ProtocolExchange -I$(COMMS)/ProtocolBase -I$(COMMS)/ProtocolRawMsg \
-I$(COMMS)/CommsCoreIF -I$(COMMS)/CommsChannelMsg -I$(COMMS)/CommsChannels -I$(COMMS)/ProtocolRICSerial \
-I$(COMMS)/ProtocolRICFrame -I$(COMMS)/ProtocolRICJSON -I$(COMMS)/RICRESTMsg -I$(COMMS)/CommsBridgeMsg

Expand Down Expand Up @@ -118,14 +118,15 @@ SOURCES_test_thread_safe_queue = test_thread_safe_queue.cpp $(COMMON_SOURCES)
SOURCES_test_simple_buffer = test_simple_buffer.cpp $(CORE)/MiniHDLC/MiniHDLC.cpp $(COMMON_SOURCES)
SOURCES_test_file_system_paths = test_file_system_paths.cpp $(COMMS_SOURCES) $(COMMON_SOURCES)
SOURCES_test_mini_hdlc = test_mini_hdlc.cpp $(CORE)/MiniHDLC/MiniHDLC.cpp $(COMMON_SOURCES)
SOURCES_test_comms_framing_vectors = test_comms_framing_vectors.cpp $(CORE)/MiniHDLC/MiniHDLC.cpp $(COMMS)/ProtocolOverAscii/ProtocolOverAscii.cpp $(COMMON_SOURCES)

SOURCES_test_device_action_encoder = test_device_action_encoder.cpp $(CORE)/DeviceTypes/DeviceActionEncoder.cpp $(COMMON_SOURCES)
SOURCES_test_mqtt_protocol = test_mqtt_protocol.cpp $(CORE)/MQTT/MQTTProtocol.cpp $(COMMON_SOURCES)
SOURCES_test_espnow_config = test_espnow_config.cpp $(ESPNOW_DIR)/ESPNowConfig.cpp $(COMMON_SOURCES)

# Tests run by "make check"
TESTS = test_raft_json test_raft_utils test_device_names test_device_settings test_device_type_settings test_device_data_subscribers test_device_type_records \
test_device_type_table test_device_type_grammar test_device_type_policy test_device_type_file test_catalogue_index test_runtime_decoder test_poll_data_decode test_bus_ident test_bus_scan_schedule test_device_poll_timing test_device_poll_scheduler test_poll_plan test_protocol_exchange test_file_upload_okto test_file_upload_background test_mini_hdlc test_mqtt_protocol test_thread_safe_queue test_simple_buffer test_file_system_paths test_led_strip_rmt_plan test_device_action_encoder
test_device_type_table test_device_type_grammar test_device_type_policy test_device_type_file test_catalogue_index test_runtime_decoder test_poll_data_decode test_bus_ident test_bus_scan_schedule test_device_poll_timing test_device_poll_scheduler test_poll_plan test_protocol_exchange test_file_upload_okto test_file_upload_background test_mini_hdlc test_mqtt_protocol test_thread_safe_queue test_simple_buffer test_file_system_paths test_led_strip_rmt_plan test_device_action_encoder test_comms_framing_vectors

# Extra device type catalogues for test_device_type_records to sweep, e.g.
# make check DEV_TYPE_CATALOGUES="../../RaftI2C/linux_unit_tests/TestDevTypeRecs.json"
Expand Down
1 change: 1 addition & 0 deletions linux_unit_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ make -C linux_unit_tests check DEV_TYPE_CATALOGUES="../../RaftI2C/linux_unit_tes
| `test_file_upload_okto` | `FileUploadOKTOProtocol`: when it acks - the first block, each batch, the last block, at once for the first block out of sequence (a lost block or one sent again), and on its timer - and that its acks stay in step with the host's batches after a loss or a timer ack |
| `test_led_strip_rmt_plan` | `LEDStripRMTPlan`: the RMT memory (or DMA buffer) an LED strip's channel asks for - the whole frame in RMT memory when it fits in the strip's share, DMA where the chip has it when it doesn't, then smaller sizes; shares between strips, a configured size, DMA modes and when a frame is refilled |
| `test_mini_hdlc` | `MiniHDLC`: frames encoded and decoded again up to 70000 bytes (past 64 KB), the frame length limit, and a 200000-byte limit (as ProtocolRICSerial sets with PSRAM) kept rather than truncated to 16 bits |
| `test_comms_framing_vectors` | Makes the shared vectors `scripts/tests/hdlc_vectors.json` and `overascii_vectors.json` from `MiniHDLC` and `ProtocolOverAscii` and fails if the files differ (the RICRESTProtocol wiki examples are checked too). Client libraries (raftjs, raftpy) test their framing against these files. After an intended change to the framing, run `./test_comms_framing_vectors --write` and copy the files to the clients |
| `test_mqtt_protocol` | `MQTTProtocol`: CONNECT (with and without credentials), PUBLISH at QoS 0 and 1 with and without retain, long remaining lengths, SUBSCRIBE and PUBACK encoded as MQTT 3.1.1 specifies; broker packets decoded whether they arrive a byte at a time, several to a read or split across reads; malformed and overlong packets rejected; topic filter wildcards |
| `test_thread_safe_queue` | `ThreadSafeQueue` (with its `SpiramAwareAllocator` deque): order, length limits, peek/pop/clear, many elements, and a producer and consumer on two threads |
| `test_simple_buffer` | `SimpleBuffer` (MiniHDLC's frame buffers): grows geometrically and only when the memory is there (fails instead of crashing), `clear()` releases a buffer grown by a long frame; frames through MiniHDLC, including after a run longer than the limit |
Expand Down
Loading
Loading