mcpplibs.mtest
importmcpplibs.mtest: the C++ test library of mtest --- cases, expectations, fixtures, bench, conformance and end-to-end helpers, with no macro and no header, speaking the mtest test protocol
import mcpplibs.mtest;
#include <mtest.h>
模块名读自上游 src/mtest.cppm 里的 `export module` 声明。
mcpp add mcpplibs.mtest@0.11.3
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
import std;
import mcpplibs.mtest;
using namespace mcpplibs::mtest;
UTest parsing{"parsing", tag{"fast"}, [] {
"a comparison holds"_test = [] { expect(eq(1 + 1, 2)); };
"a failure reports both sides"_test[expect_failure{"shown"}] = [] { expect(eq(std::string("a"), std::string("b"))); };
}};
E2E timed{"a case with a time limit", timeout{std::chrono::seconds{30}}, [] { expect(true); }};
Bench measured{"a metric within its bound", at_most{"ready", 15}, [] { metric("ready", 1.0, "s"); }};
int main() {
"parameters"_test = values{2, 4, 6} | [](int v) { expect(eq(v % 2, 0)); };
return report();
}
tests/examples/mtest/tests/cases.cpp · 项目 tests/examples/mtest
构建 · 上游清单
- modules
mcpplibs.mtest- targets
mtest (lib), main (entry)- manifest version
0.11.3- dependencies
mcpplibs, nlohmann- 来源
https://raw.githubusercontent.com/mcpp-community/mtest/v0.11.3/lib/mcpp.toml
版本
| 版本 | 平台 | 镜像 | sha256 |
|---|---|---|---|
0.11.3 最新 |
LinuxWindowsmacOS | GLOBAL CN | da46a7361a5c… |
0.11.2 |
LinuxWindowsmacOS | GLOBAL CN | 1236da4c4529… |
0.11.1 |
LinuxWindowsmacOS | GLOBAL CN | 69c45ff361a9… |
0.11.0 |
LinuxWindowsmacOS | GLOBAL CN | 457635770e34… |
0.10.0 |
LinuxWindowsmacOS | GLOBAL CN | 70c81ff6c6ef… |
展开全部 23 个版本
0.9.0 |
LinuxWindowsmacOS | GLOBALCN | 686046fff9a8… |
0.8.5 |
LinuxWindowsmacOS | GLOBALCN | 03629c481d28… |
0.8.4 |
LinuxWindowsmacOS | GLOBALCN | 842bc6e896e3… |
0.8.3 |
LinuxWindowsmacOS | GLOBALCN | f61fb09b2dda… |
0.8.0 |
LinuxWindowsmacOS | GLOBALCN | 6ea516f470ae… |
0.7.2 |
LinuxWindowsmacOS | GLOBALCN | c4e6e3d526da… |
0.7.1 |
LinuxWindowsmacOS | GLOBALCN | 4cf903fc8831… |
0.7.0 |
LinuxWindowsmacOS | GLOBALCN | ab312f844066… |
0.6.3 |
LinuxWindowsmacOS | GLOBALCN | a41e5001e400… |
0.6.0 |
LinuxWindowsmacOS | GLOBALCN | eb90f823b4b2… |
0.5.2 |
LinuxWindowsmacOS | GLOBALCN | e61819239dca… |
0.5.1 |
LinuxWindowsmacOS | GLOBALCN | 48625c19d548… |
0.5.0 |
LinuxWindowsmacOS | GLOBALCN | 586d8a2f4fb5… |
0.4.1 |
LinuxWindowsmacOS | GLOBALCN | c0a769eba5d3… |
0.4.0 |
LinuxWindowsmacOS | GLOBALCN | 9c90fc7b225a… |
0.3.0 |
LinuxWindowsmacOS | GLOBALCN | b695022706d5… |
0.2.0 |
LinuxWindowsmacOS | GLOBALCN | 600f52ff1b55… |
0.1.0 |
LinuxWindowsmacOS | GLOBALCN | 2e09528d9717… |