前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >2019-04-24 使用Testeth跑以太坊测试集

2019-04-24 使用Testeth跑以太坊测试集

作者头像
oracle3
发布2022-05-13 08:32:45
2420
发布2022-05-13 08:32:45
举报
文章被收录于专栏:oracle3技术大杂烩

参考https://github.com/ethereum/aleth/blob/master/doc/usingtesteth.rst

1、编译aleth,参考https://github.com/ethereum/aleth#building-from-source

ubuntu环境:(文档说windows环境不确保成功,mac估计没问题)

代码语言:javascript
复制
git clone --recursive https://github.com/ethereum/aleth.git
cd aleth
mkdir build; cd build  # Create a build directory.
cmake ..               # Configure the project.
cmake --build .        # Build all default targets.

2、执行testeth,参考https://github.com/ethereum/aleth/blob/master/doc/usingtesteth.rst

代码语言:javascript
复制
cd /build/test
./testeth

这样执行的是全部测试用例

3、可以执行部分测试用例:

./testeth -t <TEST_SUITE>/<TEST_CASE> <TEST_SUITE>就是../../test/jsontests/目录下的几个目录名称, <TEST_CASE>就是<TEST_SUITE>目录下的目录名称 例如:VMTests ./testeth -t VMTests 就是测试../../test/jsontests/VMTests目录下所有文件 ./testeth -t VMTests/vmSha3Test 就是测试../../test/jsontests/VMTests/vmSha3Test目录下所有文件

4、也可以测试指定文件

./testeth -t <TEST_SUITE>/<TEST_CASE> -- --singletest <TEST_NAME> <TEST_NAME>就是<TEST_CASE>目录下的文件名,不包含后缀 例如: ./testeth -t VMTests/vmSha3Test -- --singletest sha3_0 返回:

代码语言:javascript
复制
Running tests using path: "../../test/jsontests"
Running 1 test case...
Test Case "vmSha3Test": 
100%

*** No errors detected

如果我们修改sha3_0.json文件中,post段的storage值, 原始的:"0x00" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" 修改为:"0x00" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a471" 保存后,再次执行 ./testeth -t VMTests/vmSha3Test -- --singletest sha3_0 返回:

代码语言:javascript
复制
Running tests using path: "../../test/jsontests"
Running 1 test case...
Test Case "vmSha3Test": 
100%
/home/elikong/evmc/aleth/test/tools/libtesteth/ImportTest.cpp(584): error: in "VMTests/vmSha3Test": sha3_0 Check State: 0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6: incorrect storage [0x] = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470, expected [0x] = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a471

*** 1 failure is detected (5 failures are expected) in the test module "Master Test Suite"

出现了错误提示 具体测试文件的格式描述参考https://ethereum-tests.readthedocs.io/en/latest/test_types/vm_tests.html

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-05-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1、编译aleth,参考https://github.com/ethereum/aleth#building-from-source
  • 2、执行testeth,参考https://github.com/ethereum/aleth/blob/master/doc/usingtesteth.rst
  • 3、可以执行部分测试用例:
  • 4、也可以测试指定文件
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档