eos icon indicating copy to clipboard operation
eos copied to clipboard

add code coverage host functions

Open praphael opened this issue 3 years ago • 1 comments

Change Description

Adds new host functions to support contract code coverage.

Change Type

Select ONE:

  • [ ] Documentation
  • [ ] Stability bug fix
  • [ ] Other
  • [x] Other - special case

Testing Changes

Select ANY that apply:

  • [ ] New Tests
  • [ ] Existing Tests
  • [ ] Test Framework
  • [ ] CI System
  • [ ] Other

Consensus Changes

  • [ ] Consensus Changes

API Changes

  • [x] API Changes

Documentation Additions

  • [ ] Documentation Additions

praphael avatar Dec 06 '21 22:12 praphael

These new host functions should only be added to eosio-tester and rodeos not nodeos.

I'm not sure its possible with only an eosio-tester modification. Tester intrinsics only appear to work with test contracts. The test contract uses a special framework which in turn calls the normal contracts. It also has to define main(), which normal contracts don't. So I don't believe our normal contracts can be compiled as test contracts so they can use pure tester intrisics.

I have verified that the recent commit 7e6b809 works through the whole cycle,. and generates a reasonable code coverage report. We don't actually have to merge this in, we could keep it as a separate branch just for the purpose of using code coverage.

praphael avatar Dec 11 '21 23:12 praphael