Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

add code coverage host functions #10933

Open
wants to merge 35 commits into
base: develop-boxed
Choose a base branch
from

Conversation

praphael
Copy link

@praphael praphael commented Dec 6, 2021

Change Description

Adds new host functions to support contract code coverage.

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

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

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Copy link
Contributor

@heifner heifner left a comment

Choose a reason for hiding this comment

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

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

@praphael
Copy link
Author

praphael commented Dec 11, 2021

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.

libraries/rodeos/include/b1/rodeos/callbacks/coverage.hpp Outdated Show resolved Hide resolved
@@ -16,10 +17,13 @@ class coverage_maps {

cov_map_t funcnt_map;
cov_map_t linecnt_map;
eosio::name T;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used?

libraries/rodeos/include/eosio/coverage.hpp Show resolved Hide resolved
libraries/rodeos/include/eosio/coverage.hpp Outdated Show resolved Hide resolved
programs/eosio-tester/main.cpp Outdated Show resolved Hide resolved
programs/eosio-tester/main.cpp Outdated Show resolved Hide resolved
programs/eosio-tester/main.cpp Outdated Show resolved Hide resolved
libraries/rodeos/include/b1/rodeos/callbacks/coverage.hpp Outdated Show resolved Hide resolved
libraries/rodeos/include/b1/rodeos/callbacks/coverage.hpp Outdated Show resolved Hide resolved
libraries/rodeos/include/b1/rodeos/callbacks/coverage.hpp Outdated Show resolved Hide resolved
libraries/rodeos/include/b1/rodeos/callbacks/coverage.hpp Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants