7 * @author Kazuhiro Hosoi <hosoi@gree.co.jp>
8 * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
13 /** ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê */
14 define('BASE', dirname(dirname(__FILE__)));
16 // include_path¤ÎÀßÄê(¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥Ç¥£¥ì¥¯¥È¥ê¤òÄɲÃ)
20 /** Ethna´ØÏ¢¥¯¥é¥¹¤Î¥¤¥ó¥¯¥ë¡¼¥É */
21 require_once('Ethna/Ethna.php');
23 /** SimpleTest¤Î¥¤¥ó¥¯¥ë¡¼¥É */
24 require_once('simpletest/unit_tester.php');
25 require_once('simpletest/reporter.php');
26 require_once 'Ethna/test/TextDetailReporter.php';
28 /** ¥Æ¥¹¥È¥±¡¼¥¹¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê */
29 $test_dir = ETHNA_BASE . '/test';
31 $test = &new GroupTest('Ethna All tests');
33 // ¥Æ¥¹¥È¥±¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¥ê¥¹¥È¤ò¼èÆÀ
34 $file_list = getFileList($test_dir);
37 foreach ($file_list as $file) {
38 $test->addTestFile($file);
41 // ·ë²Ì¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë½ÐÎÏ
42 //$test->run(new TextReporter());
43 $test->run(new TextDetailReporter());
49 * @param string $dir_path
51 function getFileList($dir_path)
55 $dir = opendir($dir_path);
61 while($file_path = readdir($dir)) {
63 $full_path = $dir_path . '/'. $file_path;
65 if (is_file($full_path)){
67 // ¥Æ¥¹¥È¥±¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¤Î¤ßÆɤ߹þ¤à
68 if (preg_match('/^(Ethna_)(.*)(_Test.php)$/',$file_path,$matches)) {
69 $file_list[] = $full_path;
72 // ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¾ì¹ç¤Ï¡¤ºÆµ¢Åª¤ËÆɤ߹þ¤à¡¥
73 // "."¤Ç»Ï¤Þ¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÏÆɤ߹þ¤Þ¤Ê¤¤.
74 } else if (is_dir($full_path) && !preg_match('/^\./',$file_path,$matches)) {
76 $file_list = array_merge($file_list,getFileList($full_path));