Comments (4)
List of things we don't like and (ideally) want to fix:
- Currently developers need to manually specify method_id for each test following some rules (they should start from 0, corresponding "check" function needs to have method_id equal to "prepare" function method_id + 1). We want to fully remove the necessity of manual method_ids.
- Developers need to manually find function selectors of smart contract's tested methods. Ideally we want to just specify names of tested functions instead of their ids.
- Currently each test runs only one smart contract function. Would be great to be able to run several (possibly different) functions inside one test. Persistent data (c4) during each function call should be equal to what was saved during the previous call. Ideally we want to "dynamically" generate a list of functions to be called (e.g. via loops). But even if we require a number of function calls known at compile time, it will already be a huge improvement.
- Improve stack corruption error reporting. Currently if tests or smart contract functions do not behave nicely with stack (e.g. consume or add more/less entries from stack), some strange situations could happen, which is hard to debug.
- Something else?
from toncli.
Some ideas (they are all theoretical, and potentially could not work) about how to improve things.
- We need to know which functions are tests, and need to be run. Currently this is done by using specific method_ids. We can use different conventions, and use function names instead. Say, if the function name starts with "__test", we consider it as a test, and will run it. There is also a question about how to find the corresponding "checker" function. We can return a reference to the checker function (e.g. as continuation) together with other test parameters (stack, data, c7, ...) from the test function.
- As in the previous point, we can just return the tested function as continuation, not a function selector. This will require a compiling test together with the contract's code. It could lead to some problems (e.g. developers will not be able to use the same function names and global variables inside test and contracts code). But also it makes it possible to run some helper contracts functions inside tests.
- This part is the most questionable. We can generate a list of functions to be called (together with corresponding stack, c7, checker functions ...) from each test, and then run each function separately (providing c4 from previous call). We need to think about how to return this list from the test function. Also this way all function calls should be known in advance, which means they can't depend on responses from smart contracts.
from toncli.
Thanks ❤
https://github.com/disintar/toncli/blob/master/docs/advanced/func_tests_new.md
from toncli.
Thanks ❤
https://github.com/disintar/toncli/blob/master/docs/advanced/func_tests_new.md
from toncli.
Related Issues (20)
- bitstring library removed BitString class in the 4.x.x version HOT 4
- toncli run_tests -> "Stack underflow. Last op-code consume more elements ..." HOT 4
- Toncli deploys into the same address every time HOT 1
- WARNING: 🤖 Can't find executable for fift, please specify it HOT 1
- Installation step: yandex disk for libcrypto-1_1-x64.dll HOT 1
- Windows binaries download expired HOT 1
- toncli command not working for installation
- Toncli run_tests => [__test_equal_slices_contract] status: [FAIL], code: [7] HOT 1
- Tests are falling, probably due to the lack of a file stdlib.fc
- toncli does not provide deployed contract address HOT 1
- Error during deploy with toncli from master HOT 2
- Test libs import order HOT 1
- Toncli from master can't be install via pip not in edit mode
- Add working examples of NFT and Jettons for toncli HOT 1
- How to use new tests? What is the current situation over TON binaries? HOT 1
- When running tests with recent ton tools and tonclin of branch main: `contract_tests.fif ... PROC:<{:procedure already defined` HOT 4
- Unable to use toncli in directories containing Unicode characters in names
- Toncli tests success on out-of-gas HOT 1
- broken with latest 4.x.x bitstring HOT 2
- Question: how to 'initialize' deploy-wallet on mainnet? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toncli.