evm_cfg_builder icon indicating copy to clipboard operation
evm_cfg_builder copied to clipboard

Add unit tests

Open dguido opened this issue 7 years ago • 3 comments

dguido avatar Oct 05 '18 04:10 dguido

Do we have a standard unit test framework that we use?

joshwatson avatar Oct 26 '18 04:10 joshwatson

I dont think so

@mossberg was working on a fork of solc that could output the edges of a smart contract We could build unit tests on top of it

montyly avatar Oct 26 '18 10:10 montyly

Yup, the solc fork is here: https://github.com/trailofbits/solidity/tree/basic-block-edges

and some example current output:

[I] mark forge ~/c/e/s/corpus ❯ mysolc qq.sol --bin-runtime
0x7c -> [0x7d]
0xb -> [0xc, 0x3f]
0x3e -> [0x3f, 0x45]
0x4b -> [0x4c, 0x51]
0x57 -> [0x6e]
0x85 -> [0x86, 0x94]
0x93 -> [0x7d]
0x9b -> [0x58]
0xb -> [0xc, 0x11]
Warning: This is a pre-release compiler version, please do not use it in production.
qq.sol:1:1: Warning: Source file does not specify required compiler version!
contract C {
^ (Relevant source part starts here and spans across multiple lines).
qq.sol:3:1: Warning: Function state mutability can be restricted to pure
function x() public returns (uint){
^ (Relevant source part starts here and spans across multiple lines).


offlinemark avatar Oct 29 '18 11:10 offlinemark