Browse Source

Replaced "mcover" by "instrument" for code coverage

tags/v1.0.1
Cédric Belin 2 months ago
parent
commit
8f236c386c
9 changed files with 29 additions and 31 deletions
  1. +1
    -1
      lib/php/tink/cli/Doc0.php
  2. +3
    -3
      lib/php/tink/cli/Router0.php
  3. +9
    -9
      lib/php/which/Finder.php
  4. +1
    -1
      lib/php/which/FinderException.php
  5. +1
    -1
      lib/php/which/FinderTools.php
  6. +3
    -3
      lib/php/which/Process.php
  7. +6
    -6
      lib/php/which/Program.php
  8. +3
    -0
      share/test.hxml
  9. +2
    -7
      test/TestAll.hx

+ 1
- 1
lib/php/tink/cli/Doc0.php View File

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

namespace tink\cli;


+ 3
- 3
lib/php/tink/cli/Router0.php View File

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

namespace tink\cli;
@@ -78,7 +78,7 @@ class Router0 extends Router {
$i = $_g++;
$_g2 = HxString::charCodeAt($str, $i);
if ($_g2 === null) {
throw Exception::thrown("Invalid alias '-" . ((($i < 0 ? "" : mb_substr($str, $i, 1)))??'null') . "'");
throw Exception::thrown("Invalid alias '-" . ((($i < 0 ? "" : \mb_substr($str, $i, 1)))??'null') . "'");
} else {
if ($_g2 === 97) {
$this->command->all = true;
@@ -89,7 +89,7 @@ class Router0 extends Router {
} else if ($_g2 === 118) {
$this->command->version = true;
} else {
throw Exception::thrown("Invalid alias '-" . ((($i < 0 ? "" : mb_substr($str, $i, 1)))??'null') . "'");
throw Exception::thrown("Invalid alias '-" . ((($i < 0 ? "" : \mb_substr($str, $i, 1)))??'null') . "'");
}
}
}


+ 9
- 9
lib/php/which/Finder.php View File

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

namespace which;
@@ -64,9 +64,9 @@ class Finder {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = mb_strtolower($data[$_g_current++]);
$result[] = \mb_strtolower($data[$_g_current++]);
}
$tmp = \Array_hx::wrap($result);
} else {
@@ -120,7 +120,7 @@ class Finder {
* @return bool
*/
public function checkFileExtension ($file) {
return $this->extensions->indexOf("." . (mb_strtolower(Path::extension($file))??'null')) !== -1;
return $this->extensions->indexOf("." . (\mb_strtolower(Path::extension($file))??'null')) !== -1;
}

/**
@@ -171,7 +171,7 @@ class Finder {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $_gthis->findExecutables($data[$_g_current++], $command);
}
@@ -208,7 +208,7 @@ class Finder {
$result = [];
$data = $_this->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = \StringTools::replace(Path::join(\Array_hx::wrap([
$basePath,
@@ -219,7 +219,7 @@ class Finder {
$result = [];
$data = $paths->arr;
$_g_current = 0;
$_g_length = count($data);
$_g_length = \count($data);
while ($_g_current < $_g_length) {
$result[] = $_gthis->isExecutable($data[$_g_current++]);
}
@@ -244,8 +244,8 @@ class Finder {
* @return Thenable
*/
public function isExecutable ($file) {
clearstatcache(true, $file);
if (!file_exists($file) || FileSystem::isDirectory($file)) {
\clearstatcache(true, $file);
if (!\file_exists($file) || FileSystem::isDirectory($file)) {
return Promise_Impl_::resolve(false);
}
if (is_executable($file)) {


+ 1
- 1
lib/php/which/FinderException.php View File

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

namespace which;


+ 1
- 1
lib/php/which/FinderTools.php View File

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

namespace which;


+ 3
- 3
lib/php/which/Process.php View File

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

namespace which;
@@ -38,7 +38,7 @@ class Process {
* @return Thenable
*/
public static function get_gid () {
if (function_exists("posix_getgid")) {
if (\function_exists("posix_getgid")) {
return Promise_Impl_::resolve(posix_getgid());
}
return Process::getProcessId("g");
@@ -50,7 +50,7 @@ class Process {
* @return Thenable
*/
public static function get_uid () {
if (function_exists("posix_getuid")) {
if (\function_exists("posix_getuid")) {
return Promise_Impl_::resolve(posix_getuid());
}
return Process::getProcessId("u");


+ 6
- 6
lib/php/which/Program.php View File

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

namespace which;
@@ -76,15 +76,15 @@ class Program {
public function run ($rest) {
$_gthis = $this;
if ($this->help) {
echo((\Std::string((new DefaultFormatter())->format(Doc0::get()))??'null') . PHP_EOL);
echo((\Std::string((new DefaultFormatter())->format(Doc0::get()))??'null') . \PHP_EOL);
exit(0);
}
if ($this->version) {
echo("1.0.0" . PHP_EOL);
echo("1.0.0" . \PHP_EOL);
exit(0);
}
if (($rest->length === 0) || ((\Sys::getEnv("HAXELIB_RUN") === "1") && ($rest->length === 1))) {
echo("You must provide the name of a command to find." . PHP_EOL);
echo("You must provide the name of a command to find." . \PHP_EOL);
exit(64);
}
return new SyncFuture(new LazyConst(Outcome::Success(PromiseTools::catch_(Promise_Impl_::then(FinderTools::which(($rest->arr[0] ?? null), ["all" => $this->all]), function ($executables) use (&$_gthis) {
@@ -97,11 +97,11 @@ class Program {
}), function ($e) use (&$rest, &$_gthis) {
if (($e instanceof FinderException)) {
if (!$_gthis->silent) {
echo((\Std::string("No \"" . (($rest->arr[0] ?? null)??'null') . "\" in (" . ($e->finder->path->join((Finder::get_isWindows() ? ";" : ":"))??'null') . ").")??'null') . PHP_EOL);
echo((\Std::string("No \"" . (($rest->arr[0] ?? null)??'null') . "\" in (" . ($e->finder->path->join((Finder::get_isWindows() ? ";" : ":"))??'null') . ").")??'null') . \PHP_EOL);
}
exit(1);
} else {
echo((\Std::string($e)??'null') . PHP_EOL);
echo((\Std::string($e)??'null') . \PHP_EOL);
exit(2);
}
}))));


+ 3
- 0
share/test.hxml View File

@@ -1,8 +1,9 @@
--class-path src
--class-path test
--define coverage-lcov-reporter=var/lcov.info
--library instrument
--library thenshim
--library tink_cli
--library utest
--macro instrument.Instrumentation.coverage(['which'], ['src'])
--main TestAll

+ 2
- 7
test/TestAll.hx View File

@@ -1,5 +1,4 @@
import mcover.coverage.MCoverage;
import mcover.coverage.client.LcovPrintClient;
import instrument.coverage.Coverage;
import utest.UTest;
import which.*;

@@ -14,9 +13,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, Coverage.endCoverage);
}

Loading…
Cancel
Save