Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test error handling for SPI code #315

Merged
merged 27 commits into from
Dec 1, 2024
Merged

Conversation

kamilchmela
Copy link
Contributor

@kamilchmela kamilchmela commented Jul 25, 2024

Fixes #305

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 55.17241% with 91 lines in your changes missing coverage. Please review.

Project coverage is 79.34%. Comparing base (6572e5b) to head (7902cfb).

Files with missing lines Patch % Lines
Sts1CobcSw/Periphery/FlashMock.cpp 0.00% 54 Missing ⚠️
Sts1CobcSw/Hal/SpiMock.cpp 39.28% 17 Missing ⚠️
Sts1CobcSw/CobcSoftware/StartupTestThreadStubs.cpp 80.95% 8 Missing ⚠️
Sts1CobcSw/Hal/SpiMock.hpp 16.66% 5 Missing ⚠️
Sts1CobcSw/Hal/Spi.cpp 40.00% 3 Missing ⚠️
Tests/GoldenTests/SpiSupervisor.test.cpp 91.17% 3 Missing ⚠️
...CobcSoftware/SpiStartupTestAndSupervisorThread.cpp 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
- Coverage   83.35%   79.34%   -4.02%     
==========================================
  Files          37       47      +10     
  Lines        1352     1578     +226     
  Branches       50       57       +7     
==========================================
+ Hits         1127     1252     +125     
- Misses        225      326     +101     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from 7e5fde1 to 994e1bb Compare July 27, 2024 11:08
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from cd593b3 to 80b9b51 Compare August 23, 2024 13:33
@kamilchmela kamilchmela requested a review from PatrickKa August 29, 2024 15:00
Copy link
Contributor

@PatrickKa PatrickKa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • FlashMock.hpp only needs to declare what is necessary for mocking in addition to Flash.hpp. That means you need to remove everything up to and including extern hal::Spi spi; and include Flash.hpp instead. Also remove the duplicated comments at the top of the file.

Sts1CobcSw/Periphery/CMakeLists.txt Outdated Show resolved Hide resolved
Sts1CobcSw/Periphery/FlashMock.cpp Outdated Show resolved Hide resolved
Sts1CobcSw/Periphery/FlashMock.cpp Outdated Show resolved Hide resolved
Tests/HardwareTests/CMakeLists.txt Outdated Show resolved Hide resolved
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch 2 times, most recently from 3c9064f to 72944b6 Compare September 3, 2024 19:09
@kamilchmela kamilchmela force-pushed the test-error-handling-for-spi branch from ee5999c to a048173 Compare September 4, 2024 13:21
@kamilchmela kamilchmela force-pushed the test-error-handling-for-spi branch 4 times, most recently from afebffb to e7de75c Compare September 16, 2024 12:54
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch 4 times, most recently from 1969100 to 54f7c8a Compare September 23, 2024 18:38
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from 191119d to 199a3f9 Compare September 29, 2024 12:05
@kamilchmela kamilchmela force-pushed the test-error-handling-for-spi branch 3 times, most recently from fe01b0d to 09d9d18 Compare September 29, 2024 18:40
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from 51e57a4 to d5a484f Compare November 2, 2024 10:26
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from 1ac2489 to b202cf8 Compare November 9, 2024 16:28
@kamilchmela kamilchmela force-pushed the test-error-handling-for-spi branch 3 times, most recently from 61c8644 to 4b579ed Compare November 22, 2024 11:37
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch 4 times, most recently from 8a7f774 to 94f23e7 Compare November 24, 2024 18:23
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from 4a87679 to 6193951 Compare December 1, 2024 16:42
When building for sanitizers we should either use the debug or release
flags. Useing `-O2` which is neither used for release nor debug builds
is weird.
@PatrickKa PatrickKa force-pushed the test-error-handling-for-spi branch from 6193951 to 7902cfb Compare December 1, 2024 18:13
@PatrickKa PatrickKa merged commit 415e6a2 into master Dec 1, 2024
6 checks passed
@PatrickKa PatrickKa deleted the test-error-handling-for-spi branch December 1, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test error handling for SPI code
3 participants