diff --git a/.github/workflows/openkal-compat.yml b/.github/workflows/openkal-compat.yml index 8a610999..22eb99e9 100644 --- a/.github/workflows/openkal-compat.yml +++ b/.github/workflows/openkal-compat.yml @@ -42,7 +42,7 @@ env: # run if this drifts from pins.toml. See the comment beside `mcpp` in # pins.toml for why this pin, not just validate.yml's, is gated by the # index floor. - MCPP_VERSION: "2026.11.7.1" + MCPP_VERSION: "2026.11.7.2" # CROSS-VALIDATION BEFORE A RELEASE, NOT AFTER IT. # # Empty in an ordinary run, so this measurement keeps using the RELEASED diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 500b70fb..fb5006fa 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -447,7 +447,10 @@ env: # 2026.11.2.1 (mcpp-community/mcpp#882): a dependency's patches and a # dependency embedded in its consumer -- the floor openkal-musl 0.26.0 # states, since it embeds compat.mimalloc. - MCPP_VERSION: "2026.11.7.1" + # + # 2026.11.7.2: the built-in platform as one release, and the floor + # mcpplibs.mtest 0.1.0 states. + MCPP_VERSION: "2026.11.7.2" jobs: lint: diff --git a/.github/workflows/xpkgindex-update.yml b/.github/workflows/xpkgindex-update.yml index 74f75693..8379315d 100644 --- a/.github/workflows/xpkgindex-update.yml +++ b/.github/workflows/xpkgindex-update.yml @@ -25,7 +25,7 @@ concurrency: env: PYTHONUTF8: '1' - MCPP_VERSION: '2026.11.7.1' + MCPP_VERSION: '2026.11.7.2' # CROSS-VALIDATION BEFORE A RELEASE: a candidate that needs an mcpp newer # than the pin (its package states the floor) is built with mcpp built from # this branch of mcpp-community/mcpp, as openkal-compat.yml measures with it. diff --git a/CHANGELOG.md b/CHANGELOG.md index 827f420f..a60f78dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,11 @@ ### Added +- **mtest 0.1.0.** `mcpplibs.mtest`, the C++ library of the mtest test system (cases, expectations, fixtures, bench, + conformance and end-to-end helpers, no macro and no header, speaking the mtest test protocol); its GoogleTest + adapter `mcpplibs.mtest.gtest`; its C ABI `mcpplibs.mtest.capi`. The three share one tag and one archive of + mcpp-community/mtest, each descriptor naming its member's manifest. The test members `mtest`, `mtest-gtest` and + `mtest-capi` consume them. - **mcpplibs.os 0.4.0.** `is_openkal` names a build for the openkal target, as each `is_` names its own (`is_image` remains as a deprecated alias); `can_run_on(p)` and `on

(f)` ask one platform question of a native build and an image alike; the platform modules are defined in an image where it can answer them; the effective user diff --git a/mcpp.toml b/mcpp.toml index 5650e1f2..f7a027cc 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -123,6 +123,9 @@ members = [ "tests/examples/marzer.tomlplusplus-build-mcpp", "tests/examples/mcpp-plugins", "tests/examples/mio", + "tests/examples/mtest", + "tests/examples/mtest-capi", + "tests/examples/mtest-gtest", "tests/examples/muduo", "tests/examples/libmysqlclient", "tests/examples/mysql-connector-cpp", diff --git a/pkgs/m/mcpplibs.mtest.capi.lua b/pkgs/m/mcpplibs.mtest.capi.lua new file mode 100644 index 00000000..1d3f2d0d --- /dev/null +++ b/pkgs/m/mcpplibs.mtest.capi.lua @@ -0,0 +1,53 @@ +-- mcpplibs.mtest.capi --- the C ABI of the mtest test protocol. +-- +-- A package of mcpp-community/mtest (one tag, one archive): include/mtest.h and +-- a shared library through which a program of any language with a C FFI +-- reports by the protocol. +package = { + spec = "1", + namespace = "mcpplibs.mtest", + name = "capi", + description = "mtest's C ABI: the test protocol's events for any language with a C FFI", + licenses = {"Apache-2.0"}, + repo = "https://github.com/mcpp-community/mtest", + type = "package", + + extensions = { + autoupdate = { + tag = "v${version}", + url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz", + }, + }, + + xpm = { + linux = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + macosx = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + windows = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + }, + + mcpp = "*/capi/mcpp.toml", +} diff --git a/pkgs/m/mcpplibs.mtest.gtest.lua b/pkgs/m/mcpplibs.mtest.gtest.lua new file mode 100644 index 00000000..96ec17a5 --- /dev/null +++ b/pkgs/m/mcpplibs.mtest.gtest.lua @@ -0,0 +1,52 @@ +-- mcpplibs.mtest.gtest --- GoogleTest speaking the mtest test protocol. +-- +-- A package of mcpp-community/mtest (one tag, one archive): a test main that +-- lists, selects and reports GoogleTest's cases by the protocol, level 1. +package = { + spec = "1", + namespace = "mcpplibs.mtest", + name = "gtest", + description = "GoogleTest speaking the mtest test protocol: a test main that lists, selects and reports GoogleTest's cases", + licenses = {"Apache-2.0"}, + repo = "https://github.com/mcpp-community/mtest", + type = "package", + + extensions = { + autoupdate = { + tag = "v${version}", + url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz", + }, + }, + + xpm = { + linux = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + macosx = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + windows = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + }, + + mcpp = "*/adapters/gtest/mcpp.toml", +} diff --git a/pkgs/m/mtest.lua b/pkgs/m/mtest.lua new file mode 100644 index 00000000..ffe5e9ba --- /dev/null +++ b/pkgs/m/mtest.lua @@ -0,0 +1,55 @@ +-- mtest --- mcpplibs.mtest, the C++ library of the mtest test system. +-- +-- One of the packages of mcpp-community/mtest, which share one tag and one +-- archive; each descriptor names its member's manifest. Cases, expectations, +-- fixtures and attributes with no macro and no header; a program built with it +-- speaks the mtest test protocol (spec/protocol.md), and its entry begins a +-- test file that defines no `main` (mcpp 2026.11.8.1 and later). +package = { + spec = "1", + namespace = "mcpplibs", + name = "mtest", + 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", + licenses = {"Apache-2.0"}, + repo = "https://github.com/mcpp-community/mtest", + type = "package", + + extensions = { + autoupdate = { + tag = "v${version}", + url = "https://github.com/mcpp-community/mtest/archive/refs/tags/${tag}.tar.gz", + }, + }, + + xpm = { + linux = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + macosx = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + windows = { + ["0.1.0"] = { + url = { + GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.1.0/mtest-v0.1.0.tar.gz", + }, + sha256 = "2e09528d97173371e0238c720cb8ac80602241f4e05d55d3acb12f21b5c95c75", + }, + }, + }, + + mcpp = "*/lib/mcpp.toml", +} diff --git a/tests/examples/mtest-capi/mcpp.toml b/tests/examples/mtest-capi/mcpp.toml new file mode 100644 index 00000000..83594271 --- /dev/null +++ b/tests/examples/mtest-capi/mcpp.toml @@ -0,0 +1,11 @@ +# mcpplibs.mtest.capi test project: a program reports a case through the C ABI (include/mtest.h and +# its shared library), as a program of any language with a C FFI does. +[package] +name = "mtest-capi-tests" +version = "0.1.0" + +[indices] +# Use the complete candidate built-in index prepared by tests/run_members.sh. + +[dependencies] +mcpplibs.mtest.capi = "0.1.0" diff --git a/tests/examples/mtest-capi/tests/report.cpp b/tests/examples/mtest-capi/tests/report.cpp new file mode 100644 index 00000000..dbac4511 --- /dev/null +++ b/tests/examples/mtest-capi/tests/report.cpp @@ -0,0 +1,7 @@ +#include +int main() { + mtest_init("c", 1); + if (mtest_listing()) { mtest_case("adds", __FILE__, __LINE__, "unit"); return mtest_done(); } + if (mtest_selected("adds")) { mtest_begin("adds"); mtest_end("adds", 1 + 1 == 2 ? "pass" : "fail", 0); } + return mtest_done(); +} diff --git a/tests/examples/mtest-gtest/mcpp.toml b/tests/examples/mtest-gtest/mcpp.toml new file mode 100644 index 00000000..9d31f3a3 --- /dev/null +++ b/tests/examples/mtest-gtest/mcpp.toml @@ -0,0 +1,16 @@ +# mcpplibs.mtest.gtest test project: GoogleTest's cases begun by the adapter's main, which reports +# them by the mtest protocol. compat.gtest is named too, so an mcpp before 2026.11.8.1 leaves its +# gtest_main.cc out of a test that begins at the adapter. +[package] +name = "mtest-gtest-tests" +version = "0.1.0" + +[indices] +# Use the complete candidate built-in index prepared by tests/run_members.sh. + +[dev-dependencies] +compat.gtest = "1.18.0" +mcpplibs.mtest.gtest = "0.1.0" + +[test] +main = { from = "mcpplibs.mtest.gtest/main" } diff --git a/tests/examples/mtest-gtest/tests/suite.cpp b/tests/examples/mtest-gtest/tests/suite.cpp new file mode 100644 index 00000000..c0ca03bb --- /dev/null +++ b/tests/examples/mtest-gtest/tests/suite.cpp @@ -0,0 +1,3 @@ +#include +TEST(Arithmetic, Adds) { EXPECT_EQ(1 + 1, 2); } +TEST(Arithmetic, Multiplies) { EXPECT_EQ(2 * 3, 6); } diff --git a/tests/examples/mtest/mcpp.toml b/tests/examples/mtest/mcpp.toml new file mode 100644 index 00000000..3f1a09f0 --- /dev/null +++ b/tests/examples/mtest/mcpp.toml @@ -0,0 +1,11 @@ +# mcpplibs.mtest test project: cases, expectations, an expected failure and parameters through the +# published index, reported by the library's own `report()`. +[package] +name = "mtest-tests" +version = "0.1.0" + +[indices] +# Use the complete candidate built-in index prepared by tests/run_members.sh. + +[dev-dependencies] +mcpplibs.mtest = "0.1.0" diff --git a/tests/examples/mtest/tests/cases.cpp b/tests/examples/mtest/tests/cases.cpp new file mode 100644 index 00000000..e5d3935f --- /dev/null +++ b/tests/examples/mtest/tests/cases.cpp @@ -0,0 +1,9 @@ +import std; +import mcpplibs.mtest; +using namespace mcpplibs::mtest; +int main() { + "a comparison holds"_test = [] { expect(eq(1 + 1, 2)); }; + "a failure reports both sides"_test[expect_failure{"shown"}] = [] { expect(eq(std::string("a"), std::string("b"))); }; + "parameters"_test = values{2, 4, 6} | [](int v) { expect(eq(v % 2, 0)); }; + return report(); +} diff --git a/tests/openkal/pins.toml b/tests/openkal/pins.toml index 3fd39677..1a77217b 100644 --- a/tests/openkal/pins.toml +++ b/tests/openkal/pins.toml @@ -18,6 +18,8 @@ toolchain = "llvm@22.1.8" # index requires mcpp >= 2026.9.18.1 but this is mcpp 2026.9.17.3 [E0006]" # before a single line of the member's own source is read. # +# 2026-11-08: measurement engine 2026.11.7.2 (the built-in platform is one +# release) matches all CI workflows. # 2026-11-07: measurement engine 2026.11.7.1 (version groups take part in # resolution; the built-in platform is a series) matches all CI workflows. # 2026-11-03: measurement engine 2026.11.3.1 matches all CI workflows; the @@ -149,7 +151,7 @@ toolchain = "llvm@22.1.8" # openkal-musl 0.16.0 and openkal-llvm-runtime 0.12.0), because a pin that # moves onto an unreachable or divergent asset fails every member at once and # reports it as a compatibility result. -mcpp = "2026.11.7.1" +mcpp = "2026.11.7.2" # The Windows target is named for the C environment the graph presents there, # which is musl's (openkal-musl declares `[c-abi] presents = "posix"`), not