Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve test library #442

Closed
OpportunityLiu opened this issue Jun 4, 2019 · 7 comments
Closed

Improve test library #442

OpportunityLiu opened this issue Jun 4, 2019 · 7 comments

Comments

@OpportunityLiu
Copy link
Member

测试库也可以改进下,用assert报错都看不出来有啥问题

Originally posted by @OpportunityLiu in https://github.com/_render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMTc3NzA5OTc0OnYy/pull_request_review_threads/discussion

@OpportunityLiu
Copy link
Member Author

OpportunityLiu commented Jun 4, 2019

  • 补充测试用的帮助方法
  • 优化测试输出结果
  • 补充测试内容

@waruqi
Copy link
Member

waruqi commented Jun 4, 2019

? 加上assert message不就好了,而且加 -v -D 执行就看到完整栈信息 xmake l -v -D ./tests/test.lua ,定位到对应哪个assert出了问题,很方便啊,个人觉得定位问题够用了

assert(false, "assert message: %s", "xxx")

@OpportunityLiu
Copy link
Member Author

起码能提示下expact和actual,一条一条写提示信息得累死

@OpportunityLiu
Copy link
Member Author

就现在这个写测试的复杂度,我也很能理解为啥ut会缺这么多。

一个人写没有这些无所谓,多人参与以后没有足够的ut控制代码质量会很快下降的。
这块我可以重构下,起码加几个are_equal are_identity啥的

@waruqi
Copy link
Member

waruqi commented Jun 4, 2019

恩,你可以改进下,封装的通用测试接口暂时还是先放置在tests/目录下吧

tests不全,跟复杂度倒是没啥关系,弄得再简单,我一个人确实没这么多精力经常去同步维护tests,现在空闲时间太少,还要同步文档。

@OpportunityLiu
Copy link
Member Author

最好还是能根据注释自动生成,不过这又是个天坑了

@waruqi
Copy link
Member

waruqi commented Jun 4, 2019

最好还是能根据注释自动生成,不过这又是个天坑了

这个坑我暂时不打算躺了,等以后有时间吧。。

@waruqi waruqi added this to the v2.2.7 milestone Jun 5, 2019
@OpportunityLiu OpportunityLiu mentioned this issue Jun 5, 2019
4 tasks
@waruqi waruqi closed this as completed Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants