Skip to content

Commit e873dc9

Browse files
committed
test: case 860 counts a member's steps by edge, so the Windows runtime deployment written for every member is no member's
1 parent a313e72 commit e873dc9

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

‎.agents/docs/2026-11-20-test-architecture-upgrade-design.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,10 @@ doctest 适配器(5.14)、依赖的调试信息(5.15)。boost-m 自己
10101010
build program 的编译同时进行。每个编译等待自己单元的扫描;三个处理器的 macOS runner 上同一文件的三次扫描用时 0.19、
10111011
1.65 与 2.75 s,编译(各 0.7 至 0.9 s)先后进行,用例失败,重跑通过。编译是否重叠由扫描的用时决定,不是构建图的性质;
10121012
图的性质是各成员的 build program 在同一张图中并行推进,三个成员的扫描在图开始后 35 ms 内同时开始。断言改为成员的步骤
1013-
(扫描、编译、链接):`-j 4` 时至少两个成员的步骤同时进行,`-j 1` 时同一时刻只有一个成员;各成员的编译仍须有记录。
1013+
(扫描、编译、资源、链接):`-j 4` 时至少两个成员的步骤同时进行,`-j 1` 时同一时刻只有一个成员;各成员的编译仍须有记录。
1014+
步骤按边计:日志中同一命令的各行(命令的哈希与时间相同)是一条边,一条边写的文件都属于一个成员时才是该成员的步骤。
1015+
Windows 上为各成员的程序部署 C++ 运行时 DLL 的边写入三个成员的目录,按行计时它使 `-j 1` 显得三个成员同时进行
1016+
(运行 44988440716),按边计它不属于任何成员。
10141017

10151018
## 15. 子方案
10161019

‎tests/e2e/workspace/graph.cpp‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,26 @@ export int consumer_flag_v() {
411411
for (std::string m : {"pa", "pb", "pc"})
412412
expect(fatal(span(m).has_value())) << part << ": the build programs' .ninja_log does not record the compile of " << m;
413413
};
414-
// The steps of each member's build program -- its scan, compile and link (`obj/<m>-...`,
415-
// `bin/<m>-...`) -- and the most members with a step under way at one instant.
414+
// The steps of each member's build program -- its scan, compile, resource and link
415+
// (`obj/<m>-...`, `res/<m>-...`, `bin/<m>-...`) -- and the most members with a step under
416+
// way at one instant. A step is an edge: the log's rows of one command share its hash and
417+
// times (an edge writes several files), and an edge is a member's when every file it
418+
// writes is that member's. The edge that deploys the C++ runtime's DLLs beside each
419+
// member's program on Windows writes into all three, and is no member's step.
416420
const auto steps = [&](std::string_view part) {
417-
std::vector<std::pair<std::string, std::pair<long, long>>> out;
418421
const auto logs = s::find_files(ws.at("target/.build-mcpp/host"), R"(\.ninja_log)");
419422
expect(fatal(!logs.empty())) << part << ": the build programs' graph left no .ninja_log";
420-
const std::regex re{R"(^(obj|bin)/(p[abc])-[0-9a-f]+/)"};
421-
for (const auto& row : ninja_rows(logs.front()))
422-
if (std::smatch m; std::regex_search(row[3], m, re)) out.push_back({m[2].str(), {std::stol(row[0]), std::stol(row[1])}});
423+
const std::regex re{R"(^(obj|res|bin)/(p[abc])-[0-9a-f]+/)"};
424+
std::map<std::string, std::pair<std::set<std::string>, std::pair<long, long>>> edges;
425+
for (const auto& row : ninja_rows(logs.front())) {
426+
auto& edge = edges[(row.size() > 4 ? row[4] : row[3]) + "@" + row[0] + "-" + row[1]];
427+
edge.second = {std::stol(row[0]), std::stol(row[1])};
428+
std::smatch m;
429+
edge.first.insert(std::regex_search(row[3], m, re) ? m[2].str() : std::string{"-"});
430+
}
431+
std::vector<std::pair<std::string, std::pair<long, long>>> out;
432+
for (const auto& [_, edge] : edges)
433+
if (edge.first.size() == 1 && *edge.first.begin() != "-") out.push_back({*edge.first.begin(), edge.second});
423434
return out;
424435
};
425436
const auto members_at_once = [](const std::vector<std::pair<std::string, std::pair<long, long>>>& all) {

0 commit comments

Comments
 (0)