boost-ext.ut
import[Boost::ext].UT — C++20 single-header unit testing framework, exposed as the C++23 module boost.ut
import boost.ut;
mcpp add boost-ext.ut@2.3.1
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// Behavioral test: build two tests under [Boost::ext].UT via `import boost.ut;`,
// then exercise the UDL ("..."_test) and function-call (test("...")) syntaxes.
// Counts test registration by reading ut's `tests_runner` directly is awkward,
// so the test instead just RUNS a passing assertion in each style; if the
// module fails to import or any expect() fails, [Boost::ext].UT reports the
// failure through its test runner and `mcpp test` returns non-zero.
import std;
import boost.ut;
using namespace boost::ut;
int main() {
"UDL syntax"_test = [] {
expect(42_i == 42);
};
test("function syntax") = [] {
expect(0_i == 0);
expect(1u == 1_u);
};
return 0;
// …
tests/examples/boost-ext.ut/tests/ut.cpp · 專案 tests/examples/boost-ext.ut
建置
- modules
boost.ut- targets
boost_ut (lib)- language
c++23- import std
- no
- include dirs
*/include/boost
原始檔 (1)
mcpp_generated/boost.ut.cppm
產生的檔案
mcpp_generated/boost.ut.cppm
版本
| 版本 | 平台 | 鏡像 | sha256 |
|---|---|---|---|
2.3.1 最新 |
LinuxWindowsmacOS | 來源 | e51bf1873705… |