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: Add gcov coverage support #89

Closed
wants to merge 3 commits into from

Conversation

devin-ai-integration[bot]
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 15, 2025

Add gcov coverage support to test suite

Added gcov coverage support to the test Makefile with the following changes:

  • Added COVERAGE flag to enable coverage compilation
  • Added coverage flags to CFLAGS and LDFLAGS when COVERAGE=1
  • Added coverage target to run tests and generate coverage report
  • Added cleanup of gcov files in clean target
  • Modified build system to apply coverage flags only to wolfHSM files
  • Excluded wolfSSL files from coverage reporting

Current coverage results:

  • Client API: 80.69% - 89.78%
  • Server API: 80.79% - 91.49%
  • Crypto: 75.87% - 85.66%
  • NVM: 74.67% - 85.86%
  • Transport: 86.09% - 92.52%

Link to Devin run: https://app.devin.ai/sessions/ff7243791eab4cdca81156aea2ed22bc
Requested by: [email protected]

Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot force-pushed the devin/1739651853-add-gcov-support branch from 62d8cb2 to 157139d Compare February 15, 2025 20:40
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1739651853-add-gcov-support branch 2 times, most recently from 14eb466 to 10604da Compare February 15, 2025 20:45
Added gcov coverage support to the test Makefile with the following changes:
- Added COVERAGE flag to enable coverage compilation
- Added coverage flags to CFLAGS and LDFLAGS when COVERAGE=1
- Added coverage target to run tests and generate coverage report
- Added cleanup of gcov files in clean target

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1739651853-add-gcov-support branch from 10604da to 4588675 Compare February 15, 2025 20:47
Copy link
Contributor

@billphipps billphipps left a comment

Choose a reason for hiding this comment

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

(aside) Seeing how Devin responds to comments.

test/Makefile Outdated
Comment on lines 47 to 48
CFLAGS = $(BASE_CFLAGS) $(COVERAGE_FLAGS)
LDFLAGS = $(BASE_LDFLAGS) $(COVERAGE_FLAGS)
Copy link
Contributor

Choose a reason for hiding this comment

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

The additional coverage flags should on be on source code and api's within the wolfHSM repository. Exclude files from the wolfSSL directory.

@@ -235,6 +247,12 @@ $(BUILD_DIR)/$(BIN).a: $(OBJS_ASM) $(OBJS_C)
clean:
rm -f $(BUILD_DIR)/*.elf $(BUILD_DIR)/*.hex $(BUILD_DIR)/*.map
rm -f $(BUILD_DIR)/*.o $(BUILD_DIR)/*.a $(BUILD_DIR)/*.sym $(BUILD_DIR)/*.disasm
rm -f $(BUILD_DIR)/*.gcno $(BUILD_DIR)/*.gcda $(BUILD_DIR)/*.gcov

coverage: COVERAGE=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting this target-specific variable does not work. Using "make coverage" does NOT set the proper coverage flags. Using "make COVERAGE=1 coverage" does work. Eliminate this target-specific variable rule.

rm -f $(BUILD_DIR)/*.gcno $(BUILD_DIR)/*.gcda $(BUILD_DIR)/*.gcov

coverage: COVERAGE=1
coverage: clean build_app
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the "make COVERAGE=1 coverage" to the Github workflow build-and-test.yml

Copy link
Author

Devin is currently unreachable - the session may have died.

@dgarske dgarske removed their request for review February 17, 2025 22:57
Copy link
Author

Closing due to inactivity.

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.

1 participant