substr($raiz,strrpos($raiz, DIRECTORY_SEPARATOR)+1), 'raiz'=> $raiz, 'tipo'=> $tipo, ); } /** * invoca a phpunit */ function phpunit($clase) { exec("phpunit --skeleton-test $clase igep/tests/test_incprj.php", $out); print implode("\n",$out); } /** * Programa principal * */ if ($argc != 2) { die($uso); } $resource_name=$argv[1]; $resource_parts = pathinfo($resource_name); $clase = $resource_parts['filename']; $info = info_ruta($resource_name); $prj = $info['prj']; chdir($info['raiz']); switch ($info['tipo']) { case 1: echo "--- generando clase '$clase' de gvHIDRA ---\n"; phpunit($clase); break; case 2: echo "--- generando clase '$clase' de prj '$prj' ---\n"; phpunit($clase); rename("igep/tests/{$clase}Test.php", "tests/{$clase}Test.php"); break; } echo "\nBorrar el include al principio del fichero generado."; ?>