tests: adapt belt brim coverage to upstream validation

This commit is contained in:
harrierpigeon
2026-08-25 10:27:08 -05:00
parent d289478618
commit 30351d40e1
2 changed files with 21 additions and 10 deletions
+4 -1
View File
@@ -446,7 +446,10 @@ int role_passes(const std::string &gcode, const std::string &role)
bool in_role = false;
GCodeReader reader;
reader.parse_buffer(gcode, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) {
if (! line.extruding(self)) return;
// E-only unretraction moves have positive E but do not lay down material. Ignoring
// them keeps a role pass contiguous across travel/retraction bookkeeping.
if (! line.extruding(self) || (line.dist_XY(self) <= EPSILON && std::abs(line.dist_Z(self)) <= EPSILON))
return;
const bool is_role = line.comment().find(role) != std::string_view::npos;
if (is_role && ! in_role) ++passes;
in_role = is_role;