$lines++; } if ($_v >= 1) { $total++; } } $avg[$file] = round($total / $lines * 100, 2); } else { $avg[$file] = 0; } }, $_file); } $total = 0.0; foreach ($avg as $_c) { $total += $_c; } \unittest\Output::send('--------------------', \unittest\Output::DEBUG, true); \unittest\Output::send(sprintf('Total Test Coverage : %s%%', round($total / (count($avg) * 100) * 100, 2)), \unittest\Output::DEBUG, true); \unittest\Output::send('--------------------', \unittest\Output::DEBUG, true); foreach ($avg as $_k => $_c) { \unittest\Output::send(sprintf('File : %s', $_k), \unittest\Output::DEBUG, true); \unittest\Output::send(sprintf('Coverage : %s%%', $_c), \unittest\Output::DEBUG, true); \unittest\Output::send('--------------------', \unittest\Output::DEBUG, true); } }); } xp_import("unittest"); // load the standard unittest output unittest\generate_output(); // make sure we save the event history xp_set_signal_history(true);