Browse Source

Replaced "mcover" by "instrument" for code coverage

main
Cédric Belin 1 week ago
parent
commit
771062b81a
11 changed files with 20 additions and 25 deletions
  1. +2
    -2
      lib/php/lcov/BranchCoverage.php
  2. +1
    -1
      lib/php/lcov/BranchData.php
  3. +3
    -3
      lib/php/lcov/FunctionCoverage.php
  4. +1
    -1
      lib/php/lcov/FunctionData.php
  5. +1
    -1
      lib/php/lcov/LcovException.php
  6. +2
    -2
      lib/php/lcov/LineCoverage.php
  7. +1
    -1
      lib/php/lcov/LineData.php
  8. +1
    -1
      lib/php/lcov/Record.php
  9. +4
    -4
      lib/php/lcov/Report.php
  10. +3
    -2
      share/test.hxml
  11. +1
    -7
      test/TestAll.hx

+ 2
- 2
lib/php/lcov/BranchCoverage.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;
@@ -58,7 +58,7 @@ class BranchCoverage {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $data[$_g_current++]->toString();
}


+ 1
- 1
lib/php/lcov/BranchData.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;


+ 3
- 3
lib/php/lcov/FunctionCoverage.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;
@@ -58,7 +58,7 @@ class FunctionCoverage {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $data[$_g_current++]->toString(true);
}
@@ -68,7 +68,7 @@ class FunctionCoverage {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $data[$_g_current++]->toString(false);
}


+ 1
- 1
lib/php/lcov/FunctionData.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;


+ 1
- 1
lib/php/lcov/LcovException.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;


+ 2
- 2
lib/php/lcov/LineCoverage.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;
@@ -58,7 +58,7 @@ class LineCoverage {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $data[$_g_current++]->toString();
}


+ 1
- 1
lib/php/lcov/LineData.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;


+ 1
- 1
lib/php/lcov/Record.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;


+ 4
- 4
lib/php/lcov/Report.php View File

@@ -1,6 +1,6 @@
<?php
/**
* Generated by Haxe 4.1.2
* Generated by Haxe 4.1.3
*/

namespace lcov;
@@ -41,7 +41,7 @@ class Report {
$line = ($_g1->arr[$_g] ?? null);
++$_g;
$offset += mb_strlen($line);
$line = trim($line);
$line = \trim($line);
if (mb_strlen($line) === 0) {
continue;
}
@@ -52,7 +52,7 @@ class Report {
if ($parts->length > 0) {
$parts->length--;
}
$token = array_shift($parts->arr);
$token = \array_shift($parts->arr);
$data = HxString::split($parts->join(":"), ",");
if ($token === "BRDA") {
if ($data->length < 4) {
@@ -161,7 +161,7 @@ class Report {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $data[$_g_current++]->toString();
}


+ 3
- 2
share/test.hxml View File

@@ -1,7 +1,8 @@
--class-path src
--class-path test
--library mcover
--define coverage-lcov-reporter=var/lcov.info
--library instrument
--library utest
--macro mcover.MCover.coverage([''], ['src'])
--macro instrument.Instrumentation.coverage(['lcov'], ['src'])
--main TestAll
--resource test/fixtures/lcov.info@report

+ 1
- 7
test/TestAll.hx View File

@@ -1,6 +1,4 @@
import lcov.*;
import mcover.coverage.MCoverage;
import mcover.coverage.client.LcovPrintClient;
import utest.UTest;

/** Runs the test suite. **/
@@ -19,9 +17,5 @@ class TestAll {
];

/** Application entry point. **/
static function main() UTest.run(tests, () -> {
final logger = MCoverage.getLogger();
logger.addClient(new LcovPrintClient("which", "var/lcov.info"));
logger.report();
});
static function main() UTest.run(tests);
}

Loading…
Cancel
Save