Conversation
…nd readUntil functions and it's tests
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 3 critical |
🟢 Metrics 62 complexity · -9 duplication
Metric Results Complexity 62 Duplication -9
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull request overview
Adds raw byte read/write support to libserial::Serial, updates the unit tests to use the new non-shared_ptr APIs, and introduces an optional serialctl CLI build target.
Changes:
- Replaced
shared_ptr<std::string>read/write APIs withstd::string&/std::string_viewvariants and addedwriteRaw()/readRaw(). - Expanded PTY-based tests to cover raw read/write behavior and error handling.
- Added
BUILD_APPCMake option to build/install aserialctlCLI.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/serialctl.cpp | New CLI for listing serial ports and printing basic info. |
| src/serial.cpp | Implements new raw read/write APIs and updates existing read/write signatures/behavior. |
| include/libserial/serial.hpp | Updates public API declarations and adds test hooks for injected write() syscall. |
| test/test_serial_simple.cpp | Updates simple unit tests for new string/string_view APIs; adds writeRaw validation tests. |
| test/test_serial_pty.cpp | Updates PTY integration tests; adds coverage for raw read/write scenarios. |
| test/test_ports.cpp | Adjusts device ordering assertions for scanned devices. |
| CMakeLists.txt | Adds BUILD_APP option to build/install the new serialctl tool. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR introduces raw (byte-buffer) read/write support in libserial::Serial, modernizes the string-based read/write API away from std::shared_ptr<std::string>, and adds an optional CLI (serialctl) to list available serial ports.
Changes:
- Add
Serial::writeRaw(...)andSerial::readRaw(...)for raw byte I/O, including test hooks for injectingwrite()behavior. - Change string-based I/O APIs to use
std::string&(read) andstd::string_view(write), updating tests accordingly. - Add an optionally-built/installable
serialctlCLI viaBUILD_APP.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
include/libserial/serial.hpp |
Updates public Serial API signatures, adds raw I/O declarations, and extends test injection hooks. |
src/serial.cpp |
Implements raw I/O, updates existing read/write implementations, and adjusts port open behavior. |
test/test_serial_simple.cpp |
Updates unit tests for the new string/reference APIs and adds basic writeRaw validation tests. |
test/test_serial_pty.cpp |
Refactors PTY tests to use the new APIs and adds comprehensive writeRaw/readRaw behavior tests. |
test/test_ports.cpp |
Makes port-name assertions order-independent. |
tools/serialctl.cpp |
Adds a small CLI to list detected serial ports. |
CMakeLists.txt |
Adds BUILD_APP option and installs serialctl when enabled. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ingView test case
…eck of open method
Summary
Changes
Details
How to test
Screenshots/Logs (optional)
Checklist
make cppcheck/make cpplint/make uncrustify[x] Example(s) tested (if touched)Risks and rollbacks