Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.8.2] - 2026-11-14

- 0.8.1 as released: its tag was made and its release was not (a test of `bench::each` held that
the call it had slowed was the slowest of all, which a loaded machine does not grant). The tests
now hold each stated call to what that call said, whichever calls the machine slowed. The library
is 0.8.1's.

## [0.8.1] - 2026-11-14

- **A measured call says what it was made of** (`bench::each`, `mcpplibs.mtest.bench`). The body's
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main() {

```toml
[dev-dependencies]
mcpplibs.mtest = "0.8.1"
mcpplibs.mtest = "0.8.2"
```

A failure names its place and both sides (`expected 2, actual 3`). Under a runner the same program
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int main() {

```toml
[dev-dependencies]
mcpplibs.mtest = "0.8.1"
mcpplibs.mtest = "0.8.2"
```

失败时给出位置与两侧的值(`expected 2, actual 3`)。在运行器之下,同一程序按协议报告;单独运行时每个用例输出一行。
Expand Down
2 changes: 1 addition & 1 deletion adapters/gtest/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[package]
namespace = "mcpplibs.mtest"
name = "gtest"
version = "0.8.1"
version = "0.8.2"
description = "GoogleTest speaking the mtest protocol: a test main that lists, selects and reports GoogleTest's cases"
license = "Apache-2.0"

Expand Down
2 changes: 1 addition & 1 deletion adapters/gtest/src/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int mcpplibs_mtest_gtest_main(int argc, char** argv) {
{"protocol", 1},
{"level", 1},
{"framework", "googletest"},
{"version", "0.8.1"},
{"version", "0.8.2"},
{"isolation", {"process", "case"}},
{"guide", "https://github.com/mcpp-community/mtest/blob/main/adapters/gtest/docs/"
"writing-tests.md"}});
Expand Down
2 changes: 1 addition & 1 deletion capi/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[package]
namespace = "mcpplibs.mtest"
name = "capi"
version = "0.8.1"
version = "0.8.2"
description = "mtest's C ABI: the protocol's events for any language with a C FFI"
license = "Apache-2.0"

Expand Down
2 changes: 1 addition & 1 deletion capi/src/mtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void mtest_init(const char* framework, int level) {
{"protocol", 1},
{"level", std::clamp(level, 1, 3)},
{"framework", text(framework)},
{"version", "0.8.1"},
{"version", "0.8.2"},
{"isolation", {"process", "case"}}});
}

Expand Down
2 changes: 1 addition & 1 deletion conformance/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[package]
namespace = "mcpplibs.mtest"
name = "conformance"
version = "0.8.1"
version = "0.8.2"
description = "The conformance suite of the mtest protocol, for every implementation of its program side"
license = "Apache-2.0"

Expand Down
2 changes: 1 addition & 1 deletion engine/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[package]
namespace = "mtest"
name = "mtest"
version = "0.8.1"
version = "0.8.2"
description = "The mtest engine: run, schedule, store, explain and analyse tests of any language"
license = "Apache-2.0"
authors = ["mcpp-community"]
Expand Down
2 changes: 1 addition & 1 deletion engine/src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ json catalog() {
plain({{"out", {{"type", "string"}}},
{"argv", {{"type", "array"}, {"items", {{"type", "string"}}}}}}),
true);
return {{"schema", "mtest.catalog/1"}, {"version", "0.8.1"}, {"tools", tools}};
return {{"schema", "mtest.catalog/1"}, {"version", "0.8.2"}, {"tools", tools}};
}

} // namespace mcpplibs::mtest::engine
4 changes: 2 additions & 2 deletions engine/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const json* tool_named(const json& tools, std::string_view name) {

cmdline::App application(const json& tools) {
auto app = cmdline::App("mtest")
.version("0.8.1")
.version("0.8.2")
.description("run tests of any language, and ask about their runs")
.option(cmdline::Option("json").global().help("print the answer's data"));
for (const auto& t : tools)
Expand Down Expand Up @@ -253,7 +253,7 @@ int main(int argc, char** argv) {
const std::string name(parsed->subcommand_name());
const auto& sub = parsed->subcommand()->get();
if (name == "version") {
std::println("mtest 0.8.1");
std::println("mtest 0.8.2");
return 0;
}
const auto cwd = std::filesystem::current_path();
Expand Down
2 changes: 1 addition & 1 deletion engine/src/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int serve(const std::filesystem::path& cwd) {
{"result",
{{"protocolVersion", params.value("protocolVersion", std::string("2025-06-18"))},
{"capabilities", {{"tools", {{"listChanged", false}}}}},
{"serverInfo", {{"name", "mtest"}, {"version", "0.8.1"}}},
{"serverInfo", {{"name", "mtest"}, {"version", "0.8.2"}}},
{"instructions",
"Run tests and ask about runs: run, plan, explain, history, analyze, graph, "
"gate, ci. A test session (test/plan, test/run, test/add, test/cancel, "
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ E2E cli{"cli", resource{"serial:home"}, timeout{std::chrono::minutes{2}}, [] { /
The entry enters the child before any case; the copy runs no case and reports nothing. The files of
one directory are then one program (mcpp `[test] programs = "directory"`) however many of them start
copies.
- The manifest names the library once: `[dev-dependencies] mcpplibs.mtest = "0.8.1"`.
- The manifest names the library once: `[dev-dependencies] mcpplibs.mtest = "0.8.2"`.
- Identifiers are stable: a selection, a history and a shard name a case by them.

## Expectations
Expand Down
2 changes: 1 addition & 1 deletion lib/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[package]
namespace = "mcpplibs"
name = "mtest"
version = "0.8.1"
version = "0.8.2"
description = "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 protocol"
license = "Apache-2.0"
authors = ["mcpp-community"]
Expand Down
2 changes: 1 addition & 1 deletion lib/src/mtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void write_program() {
{"protocol", 1},
{"level", 3},
{"framework", "mcpplibs.mtest"},
{"version", "0.8.1"},
{"version", "0.8.2"},
{"isolation", {"process", "case"}},
{"guide", "https://github.com/mcpp-community/mtest/blob/main/lib/docs/writing-tests.md"}});
}
Expand Down
30 changes: 21 additions & 9 deletions lib/tests/companions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,20 @@ int main(int argc, char** argv) {
eq(d.values[0].min, 922.0));
expect(eq(d.values[1].calls, std::size_t(10)) && eq(d.values[1].mean, 11.0))
<< "over the calls that said it";
expect(eq(d.slowest.size(), std::size_t(2)) && eq(d.slowest[0].index, std::size_t(7)) &&
eq(d.slowest[0].said, std::string("zoom 0.43")) &&
// Which calls a loaded machine slows is not this test's to say: each stated call
// carries what that call said, the slowest first.
expect(eq(d.slowest.size(), std::size_t(2)) &&
ge(d.slowest[0].seconds, d.slowest[1].seconds));
expect(eq(d.slowest[0].parts.size(), std::size_t(2)) &&
ge(d.slowest[0].parts[0].second, 0.0009) &&
eq(d.slowest[0].values[0].second, 24570.0));
for (const bench::slow_call& c : d.slowest) {
const bool slow = c.index == 7;
expect(eq(c.parts.size(), std::size_t(2)) && eq(c.parts[1].second, 0.00005))
<< c.index;
expect(eq(c.values[0].second, slow ? 24570.0 : 922.0) &&
eq(c.said, std::string(slow ? "zoom 0.43" : "")))
<< c.index;
expect(eq(c.values.size(), std::size_t(c.index % 2 == 0 ? 2 : 1)))
<< "the calls of an even turn said lists";
}
};
"a limit a call: how many passed it, and those are the ones stated; a body ends the run"_test
[kind::bench] = [] {
Expand All @@ -119,10 +127,14 @@ int main(int argc, char** argv) {
.warmup = 0,
.limit = std::chrono::microseconds{400}});
expect(eq(calls, std::size_t(12)) && eq(d.samples.size(), std::size_t(12)));
expect(eq(d.over, std::size_t(2)) && eq(d.slowest.size(), std::size_t(2)) &&
eq(d.limit, 0.0004));
const std::array<std::size_t, 2> late{d.slowest[0].index, d.slowest[1].index};
expect((late[0] == 4 && late[1] == 9) || (late[0] == 9 && late[1] == 4));
// The two that spun past the limit are over it, and stated; a loaded machine may put
// others over.
expect(ge(d.over, std::size_t(2)) &&
eq(d.slowest.size(), std::min<std::size_t>(d.over, 8)) && eq(d.limit, 0.0004));
if (d.over <= 8)
for (std::size_t late : {std::size_t(4), std::size_t(9)})
expect(std::ranges::contains(d.slowest, late, &bench::slow_call::index))
<< late;
};
"calls that say nothing keep nothing"_test[kind::bench] = [] {
auto d = bench::each("quiet", [](bench::lap&) {},
Expand Down
2 changes: 1 addition & 1 deletion manifest/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[package]
namespace = "mcpplibs.mtest"
name = "manifest"
version = "0.8.1"
version = "0.8.2"
description = "The static case manifest of mtest: the cases a source file declares, read without building it"
license = "Apache-2.0"
authors = ["mcpp-community"]
Expand Down
Loading