Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
bbyalcinkaya committed Jul 18, 2023
1 parent 03aeb4e commit 7f3af5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
.kompile*

*.pyc
venv
.hypothesis
11 changes: 6 additions & 5 deletions run_foundry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import random
from os.path import join

from hypothesis import given, settings
from hypothesis import given, settings, Verbosity
from hypothesis.strategies import integers, tuples

from run_elrond_tests import *
Expand Down Expand Up @@ -174,15 +174,16 @@ def arg_types_to_strategy(types):
def test_with_hypothesis(krun, sym_conf, init_subst, endpoint, arg_types):

def test(args):
print(">>> running:", endpoint, args)
run_test(krun, sym_conf, init_subst, endpoint, args)
print("<<< done :", endpoint, args)

test.__name__ = endpoint # show endpoint name in hypothesis logs

args_strategy = arg_types_to_strategy(arg_types)
given(args_strategy)(
settings(
deadline=5000, # set time limit for for individual run
max_examples=10 # 20 is enough for demo purposes
deadline=5000, # set time limit for for individual run
max_examples=10, # 20 is enough for demo purposes
verbosity=Verbosity.verbose,
)(test)
)()

Expand Down
2 changes: 2 additions & 0 deletions tests/contracts/foundrylike/src/test_adder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ pub trait TestAdder {
let sum_as_bytes = testapi::get_storage(&adder, &ManagedBuffer::from(b"sum"));
let sum = BigUint::from(sum_as_bytes);
testapi::assert( sum == (value + INIT_SUM) );

// testapi::assert( sum <= (INIT_SUM + 1234u32) );

}

Expand Down

0 comments on commit 7f3af5f

Please sign in to comment.