Browse Source

Lanceur de tests plus robuste

master
Cerdic 2 months ago
parent
commit
d324690da9
  1. 18
      templates/function.php
  2. 16
      tests/tb_dirs.php
  3. 16
      tests/tb_export.php
  4. 16
      tests/tb_files.php

18
templates/function.php

@ -8,10 +8,19 @@
*/
$test = '@funcname@';
$remonte = "../";
while (!is_dir($remonte."ecrire"))
$remonte = "../$remonte";
require $remonte.'tests/test.inc';
$remonte = "";
while (!is_file($remonte."test.inc") and !is_dir($remonte.'ecrire/'))
$remonte = $remonte."../";
foreach ([$remonte."test.inc", $remonte."tests/test.inc", $remonte."tests/tests/legacy/test.inc"] as $f) {
if (is_file($f)){
require $f;
break;
}
}
if (!defined('_SPIP_TEST_INC')) {
die('Impossible de trouver test.inc depuis ' .getcwd());
}
find_in_path("@filename@",'',true);
// chercher la fonction si elle n'existe pas
@ -38,4 +47,3 @@
return $essais;
}
?>

16
tests/tb_dirs.php

@ -8,10 +8,18 @@
*/
$test = 'tb_dirs';
$remonte = "../";
while (!is_dir($remonte."ecrire"))
$remonte = "../$remonte";
require $remonte.'tests/test.inc';
$remonte = "";
while (!is_file($remonte."test.inc") and !is_dir($remonte.'ecrire/'))
$remonte = $remonte."../";
foreach ([$remonte."test.inc", $remonte."tests/test.inc", $remonte."tests/tests/legacy/test.inc"] as $f) {
if (is_file($f)){
require $f;
break;
}
}
if (!defined('_SPIP_TEST_INC')) {
die('Impossible de trouver test.inc depuis ' .getcwd());
}
find_in_path("prive/exec/testbuilder_fonctions.php",'',true);
//

16
tests/tb_export.php

@ -8,10 +8,18 @@
*/
$test = 'tb_export';
$remonte = "../";
while (!is_dir($remonte."ecrire"))
$remonte = "../$remonte";
require $remonte.'tests/test.inc';
$remonte = "";
while (!is_file($remonte."test.inc") and !is_dir($remonte.'ecrire/'))
$remonte = $remonte."../";
foreach ([$remonte."test.inc", $remonte."tests/test.inc", $remonte."tests/tests/legacy/test.inc"] as $f) {
if (is_file($f)){
require $f;
break;
}
}
if (!defined('_SPIP_TEST_INC')) {
die('Impossible de trouver test.inc depuis ' .getcwd());
}
find_in_path("inc/tb_lib.php",'',true);
//

16
tests/tb_files.php

@ -8,10 +8,18 @@
*/
$test = 'tb_files';
$remonte = "../";
while (!is_dir($remonte."ecrire"))
$remonte = "../$remonte";
require $remonte.'tests/test.inc';
$remonte = "";
while (!is_file($remonte."test.inc") and !is_dir($remonte.'ecrire/'))
$remonte = $remonte."../";
foreach ([$remonte."test.inc", $remonte."tests/test.inc", $remonte."tests/tests/legacy/test.inc"] as $f) {
if (is_file($f)){
require $f;
break;
}
}
if (!defined('_SPIP_TEST_INC')) {
die('Impossible de trouver test.inc depuis ' .getcwd());
}
find_in_path("prive/exec/testbuilder_fonctions.php",'',true);
//

Loading…
Cancel
Save