Skip to content

Commit 9417eff

Browse files
authored
0.6.2: the engine and the libraries write the version they are (#12)
1 parent d70c96d commit 9417eff

17 files changed

Lines changed: 44 additions & 17 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ jobs:
3131
export PATH="$HOME/.local/bin:$PATH"
3232
clang-format --version
3333
clang-format --dry-run --Werror $files
34+
# A release states its version in each package's manifest and in what each part
35+
# writes about itself (`mtest version`, a catalog, a session, a program's hello).
36+
# 0.6.1 was released with the sources still writing 0.6.0, and a CI that pinned
37+
# 0.6.1 refused it.
38+
- name: One version in the manifests and in what the sources write
39+
run: |
40+
set -euo pipefail
41+
version=$(sed -n 's/^version *= *"\(.*\)"/\1/p' engine/mcpp.toml | head -1)
42+
bad=0
43+
for m in $(git ls-files '*/mcpp.toml'); do
44+
v=$(sed -n '/^\[package\]/,/^\[/s/^version *= *"\(.*\)"/\1/p' "$m" | head -1)
45+
[ -z "$v" ] || [ "$v" = "$version" ] || { echo "::error file=$m::version $v, the engine is $version"; bad=1; }
46+
done
47+
stated=$(git grep -nE '"version", "[0-9]+\.[0-9]+\.[0-9]+"|\.version\("[0-9.]+"\)|"mtest [0-9]+\.[0-9]+\.[0-9]+"' -- '*.cpp' '*.cppm')
48+
[ -n "$stated" ] || { echo "::error::no source states the version; this check reads nothing"; exit 1; }
49+
while IFS= read -r line; do
50+
case "$line" in *"\"$version\""*|*"mtest $version\""*) ;; *) echo "::error::$line: not $version"; bad=1 ;; esac
51+
done <<< "$stated"
52+
exit $bad
3453
- name: No local path in what is tracked
3554
run: |
3655
set -euo pipefail
@@ -142,7 +161,8 @@ jobs:
142161
mkdir -p dist unpacked
143162
cp "target/dist/$package.tar.gz" "target/dist/mtest-$version.okb" dist/
144163
tar -xzf "dist/$package.tar.gz" -C unpacked
145-
"unpacked/$package/bin/mtest" version
164+
said=$("unpacked/$package/bin/mtest" version)
165+
[ "$said" = "mtest $version" ] || { echo "::error::the packaged engine says '$said', the manifest $version"; exit 1; }
146166
python3 - "unpacked/$package/mcpp-package.json" <<'PY'
147167
import json, sys
148168
d = json.load(open(sys.argv[1]))

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.6.2] - 2026-11-12
4+
5+
- **The engine and the libraries write the version they are.** 0.6.1's manifests said 0.6.1 and its
6+
sources still wrote 0.6.0: `mtest version`, the catalog, a session's `serverInfo` and a test
7+
program's hello. A CI that asks the installed engine for its version refused it. They write 0.6.2,
8+
CI compares every source's statement with the manifests, and the packaged engine is asked.
9+
310
## [0.6.1] - 2026-11-12
411

512
- **A program judged by its exit status can say that it did not apply** (`skip_exit`, in

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main() {
3838
3939
```toml
4040
[dev-dependencies]
41-
mcpplibs.mtest = "0.6.1"
41+
mcpplibs.mtest = "0.6.2"
4242
```
4343

4444
A failure names its place and both sides (`expected 2, actual 3`). Under a runner the same program

‎README.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main() {
3737
3838
```toml
3939
[dev-dependencies]
40-
mcpplibs.mtest = "0.6.1"
40+
mcpplibs.mtest = "0.6.2"
4141
```
4242

4343
失败时给出位置与两侧的值(`expected 2, actual 3`)。在运行器之下,同一程序按协议报告;单独运行时每个用例输出一行。

‎adapters/gtest/mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[package]
1414
namespace = "mcpplibs.mtest"
1515
name = "gtest"
16-
version = "0.6.1"
16+
version = "0.6.2"
1717
description = "GoogleTest speaking the mtest protocol: a test main that lists, selects and reports GoogleTest's cases"
1818
license = "Apache-2.0"
1919

‎adapters/gtest/src/protocol.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int mcpplibs_mtest_gtest_main(int argc, char** argv) {
128128
{"protocol", 1},
129129
{"level", 1},
130130
{"framework", "googletest"},
131-
{"version", "0.6.0"},
131+
{"version", "0.6.2"},
132132
{"isolation", {"process", "case"}},
133133
{"guide", "https://github.com/mcpp-community/mtest/blob/main/adapters/gtest/docs/"
134134
"writing-tests.md"}});

‎capi/mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[package]
55
namespace = "mcpplibs.mtest"
66
name = "capi"
7-
version = "0.6.1"
7+
version = "0.6.2"
88
description = "mtest's C ABI: the protocol's events for any language with a C FFI"
99
license = "Apache-2.0"
1010

‎capi/src/mtest.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void mtest_init(const char* framework, int level) {
116116
{"protocol", 1},
117117
{"level", std::clamp(level, 1, 3)},
118118
{"framework", text(framework)},
119-
{"version", "0.6.0"},
119+
{"version", "0.6.2"},
120120
{"isolation", {"process", "case"}}});
121121
}
122122

‎conformance/mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[package]
99
namespace = "mcpplibs.mtest"
1010
name = "conformance"
11-
version = "0.6.1"
11+
version = "0.6.2"
1212
description = "The conformance suite of the mtest protocol, for every implementation of its program side"
1313
license = "Apache-2.0"
1414

‎engine/mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[package]
1111
namespace = "mtest"
1212
name = "mtest"
13-
version = "0.6.1"
13+
version = "0.6.2"
1414
description = "The mtest engine: run, schedule, store, explain and analyse tests of any language"
1515
license = "Apache-2.0"
1616
authors = ["mcpp-community"]

0 commit comments

Comments
 (0)