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
2 changes: 1 addition & 1 deletion .github/workflows/openkal-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
shell: bash
run: |
archive="mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz"
curl -L -fsS -o "$archive" \
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$archive" \
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${archive}"
tar -xzf "$archive"
root="$PWD/mcpp-${MCPP_VERSION}-linux-x86_64"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ jobs:
# needing a newer grammar cannot pass a lint pinned to an older mcpp.
- name: Download pinned mcpp
run: |
curl -L -fsS -o mcpp.tar.gz \
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o mcpp.tar.gz \
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz"
tar -xzf mcpp.tar.gz
echo "MCPP=$PWD/mcpp-${MCPP_VERSION}-linux-x86_64/bin/mcpp" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -1210,7 +1210,7 @@ jobs:
MCPP_ARCHIVE: mcpp-${{ env.MCPP_VERSION }}-linux-x86_64.tar.gz
MCPP_ROOT: mcpp-${{ env.MCPP_VERSION }}-linux-x86_64
run: |
curl -L -fsS -o "$MCPP_ARCHIVE" \
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$MCPP_ARCHIVE" \
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${MCPP_ARCHIVE}"
tar -xzf "$MCPP_ARCHIVE"
root="$PWD/$MCPP_ROOT"
Expand Down Expand Up @@ -1257,7 +1257,7 @@ jobs:
shell: bash
run: |
archive="mcpp-${MCPP_VERSION}-${{ matrix.suffix }}.tar.gz"
curl -L -fsS -o "$archive" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/$archive"
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$archive" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/$archive"
tar -xzf "$archive"
echo "MCPP=$PWD/mcpp-${MCPP_VERSION}-${{ matrix.suffix }}/bin/mcpp" >> "$GITHUB_ENV"
- name: Immutable archive, default scaffold, strict build and loopback RPC
Expand Down Expand Up @@ -1380,7 +1380,7 @@ jobs:
MCPP_ARCHIVE: mcpp-${{ env.MCPP_VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}
MCPP_ROOT: mcpp-${{ env.MCPP_VERSION }}-${{ matrix.suffix }}
run: |
curl -L -fsS -o "$MCPP_ARCHIVE" \
curl -L -fsS --retry 5 --retry-all-errors --retry-delay 10 -o "$MCPP_ARCHIVE" \
"https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${MCPP_ARCHIVE}"
case "$MCPP_ARCHIVE" in
*.zip) powershell -NoProfile -Command "Expand-Archive -Force -Path '${MCPP_ARCHIVE}' -DestinationPath '.'" ;;
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

### Added

- **mtest 0.3.0.** `mcpplibs.mtest`、`mcpplibs.mtest.gtest`、`mcpplibs.mtest.capi` 的 0.3.0 与新包
`mcpplibs.mtest.manifest`(同一标签、同一归档):一个对象即一个用例,类型即类别(`UTest`、`CTS`、`E2E`、`Bench`,
`Suite` 不声明类别),名字之后的属性说明它如何运行(资源、时限、隔离、重试、诊断)并由其声明的用例继承;静态用例
清单成为独立的包,读测试的工具不必链接测试库。测试成员 `mtest`、`mtest-gtest`、`mtest-capi` 移到 0.3.0,新成员
`mtest-manifest` 检验清单。
- **mtest 0.2.0.** `mcpplibs.mtest`、`mcpplibs.mtest.gtest`、`mcpplibs.mtest.capi` 的 0.2.0(同一标签、同一归档):
`mcpplibs.mtest.manifest` 从源文本读出测试文件声明的用例(静态用例清单);引擎增加 `[discover.<name>]` 组、
用例属性、`--shard`、覆盖映射与 `list --static`。测试成员 `mtest`、`mtest-gtest`、`mtest-capi` 随之移到 0.2.0。
- **mcpp.plugins 0.21.0。** CMake 交叉构建在动作运行时使用引擎给出的编译器、标志、归档器与目标约定(链接可执行文件或共享库的
交叉子项目需要 mcpp 2026.11.7.1);加速器规则拥有各自的代码目标,SYCL 在一个请求中给出多个 NVIDIA 架构与 SPIR-V
(mcpp#887);`plugins-progress` 写出动作的可选进度;各成员经 mcpplibs.os 0.4.0 访问系统,不包含头文件。包的下限为
Expand Down
1 change: 1 addition & 0 deletions mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ members = [
"tests/examples/mtest",
"tests/examples/mtest-capi",
"tests/examples/mtest-gtest",
"tests/examples/mtest-manifest",
"tests/examples/muduo",
"tests/examples/libmysqlclient",
"tests/examples/mysql-connector-cpp",
Expand Down
42 changes: 42 additions & 0 deletions pkgs/m/mcpplibs.mtest.capi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ package = {

xpm = {
linux = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand All @@ -30,6 +44,20 @@ package = {
},
},
macosx = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand All @@ -39,6 +67,20 @@ package = {
},
},
windows = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand Down
42 changes: 42 additions & 0 deletions pkgs/m/mcpplibs.mtest.gtest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ package = {

xpm = {
linux = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand All @@ -29,6 +43,20 @@ package = {
},
},
macosx = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand All @@ -38,6 +66,20 @@ package = {
},
},
windows = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand Down
54 changes: 54 additions & 0 deletions pkgs/m/mcpplibs.mtest.manifest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-- mcpplibs.mtest.manifest --- mtest's static case manifest.
--
-- A package of mcpp-community/mtest (one tag, one archive): the cases a source
-- file declares with mcpplibs.mtest -- objects, the cases they declare, their
-- kinds and attributes -- read from its text without building it. A tool that
-- reads tests (mtest's engine, an editor) depends on it alone.
package = {
spec = "1",
namespace = "mcpplibs.mtest",
name = "manifest",
description = "mtest's static case manifest: the cases a source file declares, with their kinds and attributes, read without building it",
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.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
},
macosx = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
},
windows = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
},
},

mcpp = "*/manifest/mcpp.toml",
}
42 changes: 42 additions & 0 deletions pkgs/m/mtest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ package = {

xpm = {
linux = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand All @@ -32,6 +46,20 @@ package = {
},
},
macosx = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand All @@ -41,6 +69,20 @@ package = {
},
},
windows = {
["0.3.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.3.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.3.0/mtest-v0.3.0.tar.gz",
},
sha256 = "b695022706d5fac107918c1d9461b953a8f462c63b78acacf52ea427e7009187",
},
["0.2.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.2.0.tar.gz",
CN = "https://gitcode.com/mcpp-res/mtest/releases/download/v0.2.0/mtest-v0.2.0.tar.gz",
},
sha256 = "600f52ff1b55489b012c16174fcded3dc9b9aea112377c783a2c9425072e03d2",
},
["0.1.0"] = {
url = {
GLOBAL = "https://github.com/mcpp-community/mtest/archive/refs/tags/v0.1.0.tar.gz",
Expand Down
43 changes: 33 additions & 10 deletions tests/autoupdate/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ def dependency_tables(table):
candidates.append((category, path.parent.name))
continue
for deps in dependency_tables(manifest):
nested = deps
for part in namespace.split("."):
nested = nested.get(part, {}) if isinstance(nested, dict) else {}
if (f"{namespace}.{name}" in deps or name in deps.get(namespace, {}) or name in nested):
if names_dependency(deps, namespace, name):
candidates.append((category, path.parent.name))
break
if not candidates:
Expand All @@ -172,12 +169,24 @@ def member_manifest(member: str) -> Path:
raise FileNotFoundError(f"consumer manifest not found: {member}")


SPEC_KEYS = {"version", "path", "git", "branch", "tag", "rev", "features", "default-features",
"optional", "host-module", "tools", "artifacts", "visibility", "linkage", "embed"}


def is_spec(value) -> bool:
"""A dependency's specification, as opposed to the table of a namespace below it: a version
string, or a table of a specification's keys (`mcpplibs.mtest.capi = "0.2.0"` makes
`mcpplibs.mtest` the table `{capi = "0.2.0"}`, which names no dependency)."""
return isinstance(value, str) or (isinstance(value, dict) and bool(SPEC_KEYS & value.keys()))


def names_dependency(deps: dict, namespace: str, name: str) -> bool:
nested = deps
for part in namespace.split("."):
nested = nested.get(part, {}) if isinstance(nested, dict) else {}
return (f"{namespace}.{name}" in deps
or name in deps.get(namespace, {}) or name in nested)
return (is_spec(deps.get(f"{namespace}.{name}"))
or is_spec(deps.get(namespace, {}).get(name) if isinstance(deps.get(namespace), dict) else None)
or (isinstance(nested, dict) and is_spec(nested.get(name))))


# The runner platforms, by the spelling a member's `cfg(os = ...)` uses.
Expand Down Expand Up @@ -232,6 +241,16 @@ def condition_platforms(condition: str) -> set[str]:
return out


def version_key(version: str) -> tuple:
"""A dotted version's order: its numeric parts as numbers, any other part
after them as text (`0.10.0` after `0.9.0`)."""
return tuple((0, int(p), "") if p.isdigit() else (1, 0, p) for p in re.split(r"[.+-]", version))


def newest(versions: set[str]) -> str:
return max(versions, key=version_key)


def matrix(plan: Path, output: Path, base: str):
build_plan = json.loads(plan.read_text(encoding="utf-8"))
# A normal bump PR already contains its candidate, so discovery says up-to-date.
Expand All @@ -247,9 +266,10 @@ def matrix(plan: Path, output: Path, base: str):
added = {v for plat, entries in new.items() for v in entries if v not in old.get(plat, {})}
if not added:
continue
if len(added) != 1:
raise RuntimeError(f"expected one added candidate for {info['id']}: {added}")
candidate = added.pop()
# A change that adds several releases of one package (two releases cut
# while its pull request was open) is proven at the newest: the one
# consumers are moved to, and whose archive the older ones precede.
candidate = newest(added)
assets = []
for plat, platform in info["platforms"].items():
if candidate not in platform["entries"]:
Expand Down Expand Up @@ -301,9 +321,12 @@ def archive_of(record):


def replace_candidate(text: str, identity: str, version: str) -> str:
# The key as a consumer writes it: the bare name under the namespace's
# table, or the identity key, quoted or not (`mcpplibs.mtest.capi = ...`,
# the form mcpp recommends since 2026.11.8.1).
namespace, name = identity.split(":", 1)
text, replacements = re.subn(
rf'(?m)^(\s*(?:{re.escape(name)}|"{re.escape(namespace)}\.{re.escape(name)}")\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$',
rf'(?m)^(\s*(?:{re.escape(name)}|"?{re.escape(namespace)}\.{re.escape(name)}"?)\s*=\s*(?:\{{\s*version\s*=\s*)?")[^"]+(".*)$',
lambda m: m[1] + version + m[2], text)
if not replacements:
# A platform the member selects (mcpp SPEC-013).
Expand Down
Loading
Loading