Skip to content

feat: add code coverage support using native-simulator#37

Merged
quake merged 1 commit into
nervosnetwork:mainfrom
quake:main
Jan 29, 2026
Merged

feat: add code coverage support using native-simulator#37
quake merged 1 commit into
nervosnetwork:mainfrom
quake:main

Conversation

@quake

@quake quake commented Jan 29, 2026

Copy link
Copy Markdown
Member
  • Add ctor dependency and coverage_flush module to native-simulator template
  • Add coverage targets to workspace Makefile (coverage, coverage-html, coverage-lcov)
  • Add coverage documentation to README.md
  • Add coverage test step to CI workflow (ubuntu-build job)

@quake quake force-pushed the main branch 3 times, most recently from 1b7fd8f to c57c435 Compare January 29, 2026 05:18
@XuJiandong

Copy link
Copy Markdown
Collaborator

The coverage test is not a frequently used feature. I suggest moving to standalone document and makefile. Then add links in README.md to these document.

- Add ctor dependency and coverage_flush module to native-simulator template
- Add coverage targets to workspace Makefile (coverage, coverage-html, coverage-lcov)
- Add coverage documentation to README.md with clear prerequisites
- Add coverage test step to CI workflow (ubuntu-latest only, not ARM)
- Update test templates to use deploy_cell_by_name() for native-simulator support

Note: Only the 'contract' template supports native-simulator feature and coverage.
Other templates (atomics-contract, stack-reorder-contract, contract-without-simulator,
standalone-contract) do not support coverage.
@quake

quake commented Jan 29, 2026

Copy link
Copy Markdown
Member Author

The coverage test is not a frequently used feature. I suggest moving to standalone document and makefile. Then add links in README.md to these document.

I'd prefer to keep coverage in the main Makefile:

  1. Coverage is essential for smart contracts - they handle real assets, it shouldn't be treated as optional.
  2. Discoverability matters - features in the main files get used; hidden ones don't.
  3. Minimal additions - ~80 lines, clearly separated, no interference with existing targets.
  4. Templates should be ready-to-use - build, test, and coverage belong together.

@quake quake merged commit be3ca9f into nervosnetwork:main Jan 29, 2026
8 checks passed
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.

3 participants