diff --git a/test/lib/coverage.php b/test/lib/coverage.php index 868b8116fc..7cbdaee746 100644 --- a/test/lib/coverage.php +++ b/test/lib/coverage.php @@ -252,6 +252,17 @@ class coverage foreach($lines as $line) { + $trimmed = trim($line); + + // 跳过class定义行 + if(preg_match('/^class\s+/i', $trimmed)) continue; + + // 跳过function定义行 + if(strpos($trimmed, 'function') !== false) continue; + + // 跳过php定义行 + if(strpos($trimmed, '') !== false) continue; + } return $lineCount;