Skip to content

Commit ab3ec46

Browse files
committed
test(596-verify): section D names the record it read, and counts them
The object was whatever `find` reached first. A run that also builds a dependency can leave more than one resolution.json under the work tree, and traversal order is not a property of the record being tested. The probe builds one project, so the count is the assertion and the file that was read is printed beside the result.
1 parent 250df40 commit ab3ec46

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

‎.agents/docs/2026-09-10-596-verify.sh‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,25 @@ section "D. mcpp reports a dlopen surface it cannot satisfy"
136136
# fails the next time the wording improves. Both denominators are asserted for
137137
# the reason they exist -- "no findings" and "nothing was examined" must not
138138
# read the same.
139-
res=$(find "$work" -name resolution.json 2>/dev/null | head -1)
139+
#
140+
# THE OBJECT IS SELECTED BY IDENTITY, NOT BY WHERE `find` ARRIVES FIRST. The
141+
# probe project's own build tree is `$work/target/<triple>/<fingerprint>`, and
142+
# a run that also builds a dependency can leave more than one resolution.json
143+
# under the work tree. "The first one" is a property of directory traversal
144+
# order, not of the record being tested, so the count is asserted and named.
145+
res=""
146+
res_n=0
147+
for candidate in "$work"/target/*/*/resolution.json; do
148+
[ -f "$candidate" ] || continue
149+
res_n=$((res_n + 1))
150+
res="$candidate"
151+
done
152+
if [ "$res_n" -gt 1 ]; then
153+
fail "D: $res_n resolution.json files under $work/target; the probe builds one project"
154+
res=""
155+
fi
140156
if [ -n "$res" ] && command -v python3 >/dev/null 2>&1; then
157+
ok "reading ${res#"$work"/}"
141158
python3 - "$res" <<'PY'
142159
import json, sys
143160
doc = json.load(open(sys.argv[1]))
@@ -166,8 +183,8 @@ if bad:
166183
print("ok: no driver soname is missing from the farm")
167184
PY
168185
[ $? -eq 0 ] || fails=$((fails + 1))
169-
else
170-
skip "D: no resolution.json (section C did not build) or no python3"
186+
elif [ "$res_n" -le 1 ]; then
187+
skip "D: no resolution.json under $work/target (section C did not build) or no python3"
171188
fi
172189

173190
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)