doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时(by orders of magnitude)和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁的界面,可直接在生产代码中编写测试。
使用自动记录测试(self-registering test )编译为可执行文件的完整示例:
doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时(by orders of magnitude)和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁的界面,可直接在生产代码中编写测试。
使用自动记录测试(self-registering test )编译为可执行文件的完整示例:
doctest 2.2.3 已发布。doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁的界面,可直接在生产代码中编写测试。 新版更新内容: Calling convention needed on a few functions #182 Terminal color is not reset when a test fails with some signal #122 testing private members - ab...
doctest 2.2.1 已发布。doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁的界面,可直接在生产代码中编写测试。 doctest 2.2.1 更新内容有: --no-throw 选项不该影响到 \<LEVEL\>\_NOTHROW asserts #173 doctest 可以在 XCode 6 和 7 上工作 (不支持 C++11 thread_local) #172 输出矢量内...
doctest 2.2.0 已发布,更新内容: remove the FAST_ versions of the binary asserts (not a breaking change!) #167 [compile times] make the DOCTEST_CONFIG_SUPER_FAST_ASSERTS identifier affect normal asserts too #166 更新日志 doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁...
doctest 2.1.0 已发布,更新内容: Closed issues: doctest::String ctor with non-zero terminated string #165 thread_local is not supported on iOS 9.0 #164 Compiler error on Android NDK r18 #163 [question] One setup for multiple tests #160 clang unwanted warning in user code #156 Unsigned integer overflow in fileOrderComparator #151 ThreadSanitizer: signal-unsafe call inside of a signal #147 Featur...
C++ 测试框架 doctest 2.0.0 已发布。该版本最大的更新莫过于将代码迁移到了 C++11 了,并表示这是受 reddit 帖子中的民意调查结果的推动。 部分更新如下 moved to C++11 - motivated by the results from the poll in this reddit thread thread-safety - asserts and logging utilities can be used in multiple threads spawned from a single test case without race conditions (thread sanitizer tested) - see example ...
doctest 1.2.8 发布了,doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时(by orders of magnitude)和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁的界面,可直接在生产代码中编写测试。 更新内容: ARM64 builds: templated_test_cases.cpp test fails #119 ARM builds: FTBFS on armhf - error: cast from 'const char*' to 'const...
doctest 1.2.7 发布了,doctest 是一个新的 C++ 测试框架。与其他功能丰富的替代方案相比,编译时(by orders of magnitude)和运行时是最快的。它提供了编译语言(如 D/Rust/Nim)的能力,并通过提供一个快速,透明和灵活的测试运行器与简洁的界面,可直接在生产代码中编写测试。 更新内容: Closed issues: MSan has runtime error: unsigned integer overflow #116 clang-tidy warning about cert-err58-cpp #115 Linking e...
divisors.py def get_divisors(num, possible_divisors): ''' (int, list of int) -> list of int Return a list of the values from possible_divisors that are divisors of num. >>> get_divisors(8, [1, 2, 3]) [1, 2] >>> get_divisors(4, [-2, 0, 2]) [-2, 2] ''' divisors = [] for item in p...
doctest是python自带的一个模块,你可以把它叫做“文档测试”(doctest)模块。 doctest的使用有两种方式:一个是嵌入到python源中。另一个是放到一个独立文件。 doctest的概念模型: Module doctest - 一个在docstrings中运行示例的框架。 在最简单的使用中,结束每个要测试的模块M: def _test(): 导入doctest doctest.testmod() 如果__name__ ==“__main__”: _测试() 然后将该模块作为脚本运行将导致在 docstrings...
前言 doctest从字面意思上看,那就是文档测试。doctest是python里面自带的一个模块,它实际上是单元测试的一种。 官方解释:doctest 模块会搜索那些看起来像交互式会话的 Python 代码片段,然后尝试执行并验证结果 doctest测试用例可以放在两个地方 函数或者方法下的注释里面 模块的开头 案例 先看第一个案例,将需要测试的片段,标准格式,需要运行的代码前面加>>> ,相当于进入cmd这种交互环境执行,期望的结果前面不需要加>>>...
引言: doctest是python的一个测试用标准库。 顾名思义,这个模块会寻找程序里面看起来像交互式Python会话的文本片段,然后运行这个会话,来判断实际运行结果和你希望的结果是否一致。 这个模块可以用来进行回归测试,或者在编写教程性的文档时使用 基本使用: 1.通过Docstrings测试 我们先创建一个example.py,代码如下 1 ''' 2 docstrings可以放的位置1 3 4 >>> sum(1, 3) 5 4 6 7 ''' 8 9 10 def sum(...
def s(x): ''' >>> s(2) #<span style="color:#cc0000;">注意这里一定要在>>>后面有空格</span> 99 >>> s(4) 16 ''' return x*x if __name__=='__main__': import doctest,mycs doctest.testmod(mycs) 在IDLE下编辑,点击F5测试,显示 File "E:/Python_Study/code\mycs.py", line 3, in mycs.s Failed example: s(2) Expected: 99 Got: 4 **********************************...
atcoder-doctest-从AtCoder问题页面生成文本。- 发布:2020-12-22 18:10:15.637633 作者: ### 作者邮箱: ### 首页:https://github.com/muro3r/AtCoder-doctest/ ### 文档:None ### 下载链接 Copy from pypi.org 查询时间:2.492ms 渲染时间:2.611ms 本文同步分享在 博客“zhenruyan”(other)。 如有侵权,请联系 support@oschina.cn 删除。 本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。...
affinitic.docpyflakes-Pyflakes your doctest-Affinitic 发布:2020-12-22 11:50:55.912220 作者:Affinitic ### 作者邮箱:jfroche@affinitic.be ### 首页:http://svn.affinitic.be/python/affinitic.docpyflakes ### 文档:None ### 下载链接 UNKNOWN Introduction Check your doctest for various errors. Depends on pyflakes (http://pypi.python.org/pypi/pyflakes). Usage example:: docpyflakes yourdoctext.txt This...
评论 (1)