Skip to contentSkip to conversation

ptest-perl: fix overly greedy SKIP detection in run-ptest

PATCH New Pratik Farkase 1 participant 1 message Aug 25

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ptest-perl: fix overly greedy SKIP detection in run-ptest

The run-ptest script uses 'grep -i SKIP' to detect skipped tests, which incorrectly marks entire test files as SKIP when they merely contain the word 'skip' in their output. This happens with:

- TAP subtest skip directives: 'ok 3 # skip PadWalker required'
- Test descriptions containing 'skip': 'ok 84 - attributes successfully skipped'

Per the TAP specification, a test file is fully skipped only when its plan line reads '1..0' (zero tests planned). Change the detection to match only this pattern.

Tested across all 12 recipes that use the default ptest-perl run-ptest. The fix corrects 19 false SKIPs to PASS across 5 recipes.

[YOCTO #13411]

AI-Generated: Assisted by Claude Sonnet 4

---
 meta/files/ptest-perl/run-ptest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/files/ptest-perl/run-ptest +1 -1
index 51e467abe7..814d50ae63 100644
@@ -8,7 +8,7 @@ for case in `find t -type f -name '*.t'`; do
     if [ $ret -ne 0 ]; then
         result=1
         echo "FAIL: ${case%.t}"
-    elif grep -i 'SKIP' $case.output; then
+    elif grep -q '^1\.\.0' $case.output; then
         echo "SKIP: ${case%.t}"
     else
         echo "PASS: ${case%.t}"
Signature · 1 line
2.43.0