py.test 与非 python 测试(特别是使用 cxxtest)
我与一个开发基于 MPI 的 C++ 数值应用程序的团队合作。该小组使用 cxxtest 构建单独的单元测试或小型套件,但是 1)使用 cxxtest 的常用功能跨目录聚合会出现一些复杂情况,2)有一些集成测试通过启动 mpirun 更容易“从外部”实现单个Python线程。
我们想使用 py.test 作为将其粘合在一起的粘合剂,因为它宣传自己能够运行非 python 测试(我可以确信跳到鼻子)。
谁能帮助我开始执行此操作的最佳实践?再说一次,因为它似乎是 py.test 所宣传的功能之一,所以我很乐意按照最初设想的方式进行。
谢谢,
伊莱
I work with a team that develops MPI-based C++ numerical applications. The group uses cxxtest for constructing individual unit tests or small suites, but 1) there are some complications aggregating across directories with cxxtest's usual features and 2) there are some integration tests that are simply easier to implement "from the outside" by launching mpirun from a single python thread.
We would like to use py.test as the glue that holds this together, since it advertises itself as being able to run non-python tests (I could be convinced to jump to nose).
Can anyone get me started on the best practice for doing this? Again, since it seems to be one of the advertised features of py.test I'd love to go about it the way that was originally envisioned.
Thanks,
Eli
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能还对 Saru 感兴趣,它是一个最小的测试框架,可让您用 python 和 C++ 编写测试
https://github.com/squishy humans/saru/wiki/Writing-tests
you might also be interested in Saru, it's a minimal testing framework that will let you write your tests in python and C++
https://github.com/squishyhumans/saru/wiki/Writing-tests
2014 年 2 月的本指南提供了一些使用 pytest 运行 C 测试的示例,也许会有帮助。
This guide from Feb 2014 has some worked examples of using pytest to run C tests, perhaps it will help.
查看 pytest-cpp,它可能正是您所需要的。
Checkout pytest-cpp, it might be exactly what you need.