Skip to content

Commit c544360

Browse files
mtest 0.1.0: mcpplibs.mtest, its GoogleTest adapter and its C ABI (#730)
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 7b54d2c commit c544360

15 files changed

Lines changed: 234 additions & 4 deletions

File tree

‎.github/workflows/openkal-compat.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ env:
4242
# run if this drifts from pins.toml. See the comment beside `mcpp` in
4343
# pins.toml for why this pin, not just validate.yml's, is gated by the
4444
# index floor.
45-
MCPP_VERSION: "2026.11.7.1"
45+
MCPP_VERSION: "2026.11.7.2"
4646
# CROSS-VALIDATION BEFORE A RELEASE, NOT AFTER IT.
4747
#
4848
# Empty in an ordinary run, so this measurement keeps using the RELEASED

‎.github/workflows/validate.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ env:
447447
# 2026.11.2.1 (mcpp-community/mcpp#882): a dependency's patches and a
448448
# dependency embedded in its consumer -- the floor openkal-musl 0.26.0
449449
# states, since it embeds compat.mimalloc.
450-
MCPP_VERSION: "2026.11.7.1"
450+
#
451+
# 2026.11.7.2: the built-in platform as one release, and the floor
452+
# mcpplibs.mtest 0.1.0 states.
453+
MCPP_VERSION: "2026.11.7.2"
451454

452455
jobs:
453456
lint:

‎.github/workflows/xpkgindex-update.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ concurrency:
2525

2626
env:
2727
PYTHONUTF8: '1'
28-
MCPP_VERSION: '2026.11.7.1'
28+
MCPP_VERSION: '2026.11.7.2'
2929
# CROSS-VALIDATION BEFORE A RELEASE: a candidate that needs an mcpp newer
3030
# than the pin (its package states the floor) is built with mcpp built from
3131
# this branch of mcpp-community/mcpp, as openkal-compat.yml measures with it.

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222

2323
### Added
2424

25+
- **mtest 0.1.0.** `mcpplibs.mtest`, the C++ library of the mtest test system (cases, expectations, fixtures, bench,
26+
conformance and end-to-end helpers, no macro and no header, speaking the mtest test protocol); its GoogleTest
27+
adapter `mcpplibs.mtest.gtest`; its C ABI `mcpplibs.mtest.capi`. The three share one tag and one archive of
28+
mcpp-community/mtest, each descriptor naming its member's manifest. The test members `mtest`, `mtest-gtest` and
29+
`mtest-capi` consume them.
2530
- **mcpplibs.os 0.4.0.** `is_openkal` names a build for the openkal target, as each `is_<platform>` names its own
2631
(`is_image` remains as a deprecated alias); `can_run_on(p)` and `on<P>(f)` ask one platform question of a native
2732
build and an image alike; the platform modules are defined in an image where it can answer them; the effective user

‎mcpp.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ members = [
123123
"tests/examples/marzer.tomlplusplus-build-mcpp",
124124
"tests/examples/mcpp-plugins",
125125
"tests/examples/mio",
126+
"tests/examples/mtest",
127+
"tests/examples/mtest-capi",
128+
"tests/examples/mtest-gtest",
126129
"tests/examples/muduo",
127130
"tests/examples/libmysqlclient",
128131
"tests/examples/mysql-connector-cpp",

‎pkgs/m/mcpplibs.mtest.capi.lua‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- mcpplibs.mtest.capi --- the C ABI of the mtest test protocol.
2+
--
3+
-- A package of mcpp-community/mtest (one tag, one archive): include/mtest.h and
4+
-- a shared library through which a program of any language with a C FFI
5+
-- reports by the protocol.
6+
package = {
7+
spec = "1",
8+
namespace = "mcpplibs.mtest",
9+
name = "capi",
10+
description = "mtest's C ABI: the test protocol's events for any language with a C FFI",
11+
licenses = {"Apache-2.0"},
12+
repo = "https://github.com/mcpp-community/mtest",
13+
type = "package",
14+
15+
extensions = {
16+
autoupdate = {
17+
tag = "v${version}",
18+
url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz",
19+
},
20+
},
21+
22+
xpm = {
23+
linux = {
24+
["0.1.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
28+
},
29+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
30+
},
31+
},
32+
macosx = {
33+
["0.1.0"] = {
34+
url = {
35+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
36+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
37+
},
38+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
39+
},
40+
},
41+
windows = {
42+
["0.1.0"] = {
43+
url = {
44+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
45+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
46+
},
47+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
48+
},
49+
},
50+
},
51+
52+
mcpp = "*/capi/mcpp.toml",
53+
}

‎pkgs/m/mcpplibs.mtest.gtest.lua‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
-- mcpplibs.mtest.gtest --- GoogleTest speaking the mtest test protocol.
2+
--
3+
-- A package of mcpp-community/mtest (one tag, one archive): a test main that
4+
-- lists, selects and reports GoogleTest's cases by the protocol, level 1.
5+
package = {
6+
spec = "1",
7+
namespace = "mcpplibs.mtest",
8+
name = "gtest",
9+
description = "GoogleTest speaking the mtest test protocol: a test main that lists, selects and reports GoogleTest's cases",
10+
licenses = {"Apache-2.0"},
11+
repo = "https://github.com/mcpp-community/mtest",
12+
type = "package",
13+
14+
extensions = {
15+
autoupdate = {
16+
tag = "v${version}",
17+
url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz",
18+
},
19+
},
20+
21+
xpm = {
22+
linux = {
23+
["0.1.0"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
27+
},
28+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
29+
},
30+
},
31+
macosx = {
32+
["0.1.0"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
36+
},
37+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
38+
},
39+
},
40+
windows = {
41+
["0.1.0"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
45+
},
46+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
47+
},
48+
},
49+
},
50+
51+
mcpp = "*/adapters/gtest/mcpp.toml",
52+
}

‎pkgs/m/mtest.lua‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
-- mtest --- mcpplibs.mtest, the C++ library of the mtest test system.
2+
--
3+
-- One of the packages of mcpp-community/mtest, which share one tag and one
4+
-- archive; each descriptor names its member's manifest. Cases, expectations,
5+
-- fixtures and attributes with no macro and no header; a program built with it
6+
-- speaks the mtest test protocol (spec/protocol.md), and its entry begins a
7+
-- test file that defines no `main` (mcpp 2026.11.8.1 and later).
8+
package = {
9+
spec = "1",
10+
namespace = "mcpplibs",
11+
name = "mtest",
12+
description = "mcpplibs.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",
13+
licenses = {"Apache-2.0"},
14+
repo = "https://github.com/mcpp-community/mtest",
15+
type = "package",
16+
17+
extensions = {
18+
autoupdate = {
19+
tag = "v${version}",
20+
url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz",
21+
},
22+
},
23+
24+
xpm = {
25+
linux = {
26+
["0.1.0"] = {
27+
url = {
28+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
29+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
30+
},
31+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
32+
},
33+
},
34+
macosx = {
35+
["0.1.0"] = {
36+
url = {
37+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
38+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
39+
},
40+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
41+
},
42+
},
43+
windows = {
44+
["0.1.0"] = {
45+
url = {
46+
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
47+
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz",
48+
},
49+
sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75",
50+
},
51+
},
52+
},
53+
54+
mcpp = "*/lib/mcpp.toml",
55+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# mcpplibs.mtest.capi test project: a program reports a case through the C ABI (include/mtest.h and
2+
# its shared library), as a program of any language with a C FFI does.
3+
[package]
4+
name = "mtest-capi-tests"
5+
version = "0.1.0"
6+
7+
[indices]
8+
# Use the complete candidate built-in index prepared by tests/run_members.sh.
9+
10+
[dependencies]
11+
mcpplibs.mtest.capi = "0.1.0"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <mtest.h>
2+
int main() {
3+
mtest_init("c", 1);
4+
if (mtest_listing()) { mtest_case("adds", __FILE__, __LINE__, "unit"); return mtest_done(); }
5+
if (mtest_selected("adds")) { mtest_begin("adds"); mtest_end("adds", 1 + 1 == 2 ? "pass" : "fail", 0); }
6+
return mtest_done();
7+
}

0 commit comments

Comments
 (0)