From e06b0287e632f03378dc12f5c7a7ac30f60dbc76 Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Sun, 8 Nov 2026 22:18:54 +0900 Subject: [PATCH] mtest 0.4.0: bounds on a case's metrics and analyze trend Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com> --- CHANGELOG.md | 4 ++++ pkgs/m/mcpplibs.mtest.capi.lua | 21 +++++++++++++++++++++ pkgs/m/mcpplibs.mtest.gtest.lua | 21 +++++++++++++++++++++ pkgs/m/mcpplibs.mtest.manifest.lua | 21 +++++++++++++++++++++ pkgs/m/mtest.lua | 21 +++++++++++++++++++++ tests/examples/mtest-capi/mcpp.toml | 2 +- tests/examples/mtest-gtest/mcpp.toml | 2 +- tests/examples/mtest-manifest/mcpp.toml | 2 +- tests/examples/mtest/mcpp.toml | 2 +- tests/examples/mtest/tests/cases.cpp | 1 + 10 files changed, 93 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b3f25df..ff1d168d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ ### Added +- **mtest 0.4.0.** `mcpplibs.mtest`、`mcpplibs.mtest.gtest`、`mcpplibs.mtest.capi`、`mcpplibs.mtest.manifest` 的 0.4.0 + (同一标签、同一归档):用例在名字之后声明其度量的界限(`at_most`、`at_least`),库在用例结束时判定(P6.5),列举、 + 静态清单与各适配器携带同一界限;引擎增加 `analyze trend`,并以替换字符保存非 UTF-8 的输出。测试成员移到 0.4.0, + `mtest` 成员增加一个带界限的 `Bench`。 - **mtest 0.3.0.** `mcpplibs.mtest`、`mcpplibs.mtest.gtest`、`mcpplibs.mtest.capi` 的 0.3.0 与新包 `mcpplibs.mtest.manifest`(同一标签、同一归档):一个对象即一个用例,类型即类别(`UTest`、`CTS`、`E2E`、`Bench`, `Suite` 不声明类别),名字之后的属性说明它如何运行(资源、时限、隔离、重试、诊断)并由其声明的用例继承;静态用例 diff --git a/pkgs/m/mcpplibs.mtest.capi.lua b/pkgs/m/mcpplibs.mtest.capi.lua index cfa14345..f458b05f 100644 --- a/pkgs/m/mcpplibs.mtest.capi.lua +++ b/pkgs/m/mcpplibs.mtest.capi.lua @@ -21,6 +21,13 @@ package = { xpm = { linux = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -44,6 +51,13 @@ package = { }, }, macosx = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -67,6 +81,13 @@ package = { }, }, windows = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", diff --git a/pkgs/m/mcpplibs.mtest.gtest.lua b/pkgs/m/mcpplibs.mtest.gtest.lua index a83a296f..dd85cf82 100644 --- a/pkgs/m/mcpplibs.mtest.gtest.lua +++ b/pkgs/m/mcpplibs.mtest.gtest.lua @@ -20,6 +20,13 @@ package = { xpm = { linux = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -43,6 +50,13 @@ package = { }, }, macosx = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -66,6 +80,13 @@ package = { }, }, windows = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", diff --git a/pkgs/m/mcpplibs.mtest.manifest.lua b/pkgs/m/mcpplibs.mtest.manifest.lua index d2956a5e..9e2471d9 100644 --- a/pkgs/m/mcpplibs.mtest.manifest.lua +++ b/pkgs/m/mcpplibs.mtest.manifest.lua @@ -22,6 +22,13 @@ package = { xpm = { linux = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -31,6 +38,13 @@ package = { }, }, macosx = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -40,6 +54,13 @@ package = { }, }, windows = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", diff --git a/pkgs/m/mtest.lua b/pkgs/m/mtest.lua index 49a2b73d..aab9518f 100644 --- a/pkgs/m/mtest.lua +++ b/pkgs/m/mtest.lua @@ -23,6 +23,13 @@ package = { xpm = { linux = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -46,6 +53,13 @@ package = { }, }, macosx = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", @@ -69,6 +83,13 @@ package = { }, }, windows = { + ["0.4.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.4.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.4.0/mtest-v0.4.0.tar.gz", + }, + sha256 = "9c90fc7b225a5d0dc562070cf3c2d1336a391c77b56755d62854bc38d2c88040", + }, ["0.3.0"] = { url = { GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz", diff --git a/tests/examples/mtest-capi/mcpp.toml b/tests/examples/mtest-capi/mcpp.toml index d5e325c4..e9b020d8 100644 --- a/tests/examples/mtest-capi/mcpp.toml +++ b/tests/examples/mtest-capi/mcpp.toml @@ -8,4 +8,4 @@ version = "0.1.0" # Use the complete candidate built-in index prepared by tests/run_members.sh. [dependencies] -mcpplibs.mtest.capi = "0.3.0" +mcpplibs.mtest.capi = "0.4.0" diff --git a/tests/examples/mtest-gtest/mcpp.toml b/tests/examples/mtest-gtest/mcpp.toml index b099c332..d43374bf 100644 --- a/tests/examples/mtest-gtest/mcpp.toml +++ b/tests/examples/mtest-gtest/mcpp.toml @@ -10,7 +10,7 @@ version = "0.1.0" [dev-dependencies] compat.gtest = "1.18.0" -mcpplibs.mtest.gtest = "0.3.0" +mcpplibs.mtest.gtest = "0.4.0" [test] main = { from = "mcpplibs.mtest.gtest/main" } diff --git a/tests/examples/mtest-manifest/mcpp.toml b/tests/examples/mtest-manifest/mcpp.toml index 5bf95643..6c290dab 100644 --- a/tests/examples/mtest-manifest/mcpp.toml +++ b/tests/examples/mtest-manifest/mcpp.toml @@ -8,4 +8,4 @@ version = "0.1.0" # Use the complete candidate built-in index prepared by tests/run_members.sh. [dependencies] -mcpplibs.mtest.manifest = "0.3.0" +mcpplibs.mtest.manifest = "0.4.0" diff --git a/tests/examples/mtest/mcpp.toml b/tests/examples/mtest/mcpp.toml index 9d72d501..b2f9f20b 100644 --- a/tests/examples/mtest/mcpp.toml +++ b/tests/examples/mtest/mcpp.toml @@ -9,4 +9,4 @@ version = "0.1.0" # Use the complete candidate built-in index prepared by tests/run_members.sh. [dev-dependencies] -mcpplibs.mtest = "0.3.0" +mcpplibs.mtest = "0.4.0" diff --git a/tests/examples/mtest/tests/cases.cpp b/tests/examples/mtest/tests/cases.cpp index 25222bf7..ddd5680a 100644 --- a/tests/examples/mtest/tests/cases.cpp +++ b/tests/examples/mtest/tests/cases.cpp @@ -7,6 +7,7 @@ UTest parsing{"parsing", tag{"fast"}, [] { "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)); };