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
Usage
From this repository's own test project — built and run by CI, not written for the website.
// 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 · project tests/examples/boost-ext.ut
Build
- modules
boost.ut- targets
boost_ut (lib)- language
c++23- import std
- no
- include dirs
*/include/boost
Sources (1)
mcpp_generated/boost.ut.cppm
Generated files
mcpp_generated/boost.ut.cppm
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
2.3.1 latest |
LinuxWindowsmacOS | source | e51bf1873705… |