Skip to content

Commit 2e91ca8

Browse files
1.4.0: a run of cases through a part names its program (#10)
test/caseResult named the job's filter as the program and the record's name as the part: cases run through a part (unit/a) were reported as the program unit/a, and CLion and Neovim placed them under a suite of that name. It now names them as the record states them, by the rule of test/result (owner_of). mcpp names a run that selects cases (--case) after the program; such a result carries no part. The design note and a comment named the Neovim command :Mcpp testInsights; it is :Mcpp test.insights. Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 9c14862 commit 2e91ca8

11 files changed

Lines changed: 55 additions & 17 deletions

File tree

‎.agents/docs/2026-11-10-tests-from-mcpp.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ A result names the program it belongs to:
9292

9393
A whole-program run therefore marks every case.
9494
- `test/caseResult`: gains the fields of a case above. It is sent for every record of the job, not
95-
only the last one; a run of a directory program writes one record per part.
95+
only the last one; a run of a directory program writes one record per part. It names the program
96+
and the part as the record does, by the rule of a result above, whatever the job's filter; mcpp
97+
2026.11.9.1 names a run that selects cases (`--case`) after the program, and its result has no part.
9698
- `test/caseEvent` (new): `{jobId, root, program, part, case, event: "begin" | "end", tMs, ...}` with
9799
the fields of a case on `end`. It is sent as mcpp writes a `case` record (`test-case-stream`).
98100
- `test/history {root, program?, case?, runs?}` (new): the store's last runs (20 by default) and each
@@ -151,7 +153,7 @@ insights are empty and say so.
151153
- A failure's `expected` and `actual` appear as two lines under it, and in its quickfix text.
152154
- A case's line carries its sign (✓, ✗) and, as virtual text, its duration and its metrics against
153155
their bounds.
154-
- `:Mcpp testInsights` opens the insights as text in a floating window. A metric's trend is drawn with
156+
- `:Mcpp test.insights` opens the insights as text in a floating window. A metric's trend is drawn with
155157
block characters (▁▂▃▅▇), and the schedule as bars.
156158

157159
## Performance
@@ -178,6 +180,6 @@ insights are empty and say so.
178180
directory's `.mock-mcpp-tests` selects them, as `.mock-mcpp-features` selects the features.
179181
- VS Code: the tree of a directory program; part results attributed to it; the diff message; the
180182
decorations' text.
181-
- Neovim: the smoke test covers live results, the virtual text and `:Mcpp testInsights`.
183+
- Neovim: the smoke test covers live results, the virtual text and `:Mcpp test.insights`.
182184
- CLion: the comparison failure and the nested suites, in the plugin's unit tests.
183185
- The insights page is rendered by a Chromium test, as the graph page is.

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
The changelog is kept by series (`X.Y`); each section lists its components' releases.
44

5+
## 1.4
6+
7+
### 1.4.0
8+
9+
Every component is 1.4.0: the backend, mcpp-vscode, mcpp-clion and mcpp-nvim (from 1.3.0).
10+
11+
- **A run of cases through a part names its program.** `test/caseResult` names the program and the part
12+
as the record states them, as `test/result` does. 1.3.0 named the job's filter as the program: cases
13+
run through a part (`unit/a`) were reported as the program `unit/a`, and CLion and Neovim placed them
14+
under a suite of that name. mcpp names a run that selects cases (`--case`) after the program; such a
15+
result carries no part.
16+
- **Docs.** The Neovim command of the test insights is `:Mcpp test.insights`.
17+
518
## 1.3
619

720
### 1.3.0

‎mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# M2/M3), where the system it runs upon is answered when the image is loaded.
1010
[package]
1111
name = "mcpp-ide"
12-
version = "1.3.0"
12+
version = "1.4.0"
1313
description = "The IDE backend for mcpp: sessions, jobs, records and view models over mcpp's control contract"
1414
license = "Apache-2.0"
1515
authors = ["mcpp-community"]

‎mide-plugins/clion/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ An individual packaged plugin can be checked without rebuilding the backend:
9999

100100
```bash
101101
xvfb-run -a gradle --no-daemon -p integration-tests test \
102-
-PpluginZip=/absolute/path/mcpp-clion-1.3.0.zip \
102+
-PpluginZip=/absolute/path/mcpp-clion-1.4.0.zip \
103103
-PmcpplsZip=/absolute/path/mcppls-clion-0.21.0.zip \
104104
-PideVersion=2026.1.5.2
105105
```

‎mide-plugins/clion/gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# where it installs (2026.1 and later); the verifier checks both ends.
33
platformType = CL
44
platformVersion = 2026.2.3
5-
pluginVersion = 1.3.0
5+
pluginVersion = 1.4.0
66
# The mcppls CLion plugin this one depends on (<depends>io.github.sunrisepeak.mcppls</depends>):
77
# its release's one package for every system, fetched for the sandbox, the tests and the verifier.
88
mcpplsPluginVersion = 0.21.0

‎mide-plugins/nvim/lua/mcpp/session.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ local uv = vim.uv or vim.loop
1313
local is_windows = vim.fn.has('win32') == 1
1414

1515
-- mcpp-nvim's version: mcpp-ide's, whose release carries it.
16-
M.version = '1.3.0'
16+
M.version = '1.4.0'
1717

1818
-- Neovim's version, as its release names it.
1919
function M.nvim_version()

‎mide-plugins/nvim/lua/mcpp/tests.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ function M.said_of(root, test, case)
323323
return said[(root or '') .. '\0' .. test .. '\0' .. case]
324324
end
325325

326-
-- ── the insights as text (`:Mcpp testInsights`) ──────────────────────────────────────────────
326+
-- ── the insights as text (`:Mcpp test.insights`) ──────────────────────────────────────────────
327327

328328
local BLOCKS = { '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█' }
329329

‎mide-plugins/vscode/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎mide-plugins/vscode/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "mcpp-vscode",
33
"displayName": "%displayName%",
44
"description": "%description%",
5-
"version": "1.3.0",
5+
"version": "1.4.0",
66
"publisher": "mcpp-community",
77
"license": "Apache-2.0",
88
"icon": "media/logo.png",

‎src/server.cppm‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export namespace mcppide::server {
3535

3636
using Json = nlohmann::json;
3737

38-
inline constexpr std::string_view kVersion = "1.3.0";
38+
inline constexpr std::string_view kVersion = "1.4.0";
3939
// THE SERIES (mcpp design 2026-11-07, D15): `X.Y` of `X.Y.Z`, shared by the backend and every editor
4040
// plugin; components of one series work together. A plugin refuses a backend of another series,
4141
// naming both versions. The backend is always `X.Y.0`: the VS Code and CLion packages carry it, so a
4242
// change of the backend is a change of every package, and it begins a series (1.3.0). `Z` is an
4343
// editor plugin's own patch.
44-
inline constexpr std::string_view kSeries = "1.3";
44+
inline constexpr std::string_view kSeries = "1.4";
4545
static_assert(kVersion.starts_with(kSeries) && kVersion.size() == kSeries.size() + 2 && kVersion.ends_with(".0"));
4646
inline constexpr int kProtocol = 2;
4747

@@ -1848,19 +1848,26 @@ Json Session::test_result_of(const std::filesystem::path& root, const Json& reco
18481848
}
18491849

18501850
// The cases of one record of a test/runCases job, each sent as `test/caseResult` with its program
1851-
// and part, a failure's message as its output.
1851+
// and part, a failure's message as its output. The record names them, as a test/result's does: the
1852+
// job's filter may be a part, and mcpp names a run that selects cases after the program.
18521853
void Session::protocol_case_results(std::string_view jobId, const std::filesystem::path& root, const std::string& test,
18531854
const Json& record) {
1855+
std::vector<testing::Program> programs;
1856+
{
1857+
std::lock_guard lock(mutex_);
1858+
if (auto it = programs_.find(root); it != programs_.end()) programs = it->second;
1859+
}
18541860
const auto part = record.value("test", "");
1861+
const auto program = testing::owner_of(part, record.value("part_of", ""), programs);
18551862
for (const auto& o : testing::protocol_outcomes(record)) {
18561863
bool truncated = false;
18571864
auto output = views::bounded_output(o.outcome.status == "failed" ? std::string_view(o.outcome.message) : std::string_view{}, truncated);
18581865
Json n = o.detail;
18591866
n["jobId"] = jobId;
18601867
n["root"] = root.generic_string();
18611868
n["test"] = test;
1862-
n["program"] = test;
1863-
if (part != test) n["part"] = part;
1869+
n["program"] = program;
1870+
if (part != program) n["part"] = part;
18641871
n["output"] = std::move(output);
18651872
n["outputTruncated"] = truncated;
18661873
rpc_.notify("mcpp-ide/test/caseResult", n);

0 commit comments

Comments
 (0)