Changeset 168
- Timestamp:
- 05/25/08 14:18:53 (8 months ago)
- Location:
- trunk/bin
- Files:
-
- 3 modified
-
specrunner (modified) (1 diff)
-
testrunner (modified) (1 diff)
-
testrunner-st (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/specrunner
r165 r168 58 58 function preload() 59 59 { 60 $file = null; 61 for ($i = 1, $count = count($_SERVER['argv']); $i < $count; ++$i) { 62 if (!preg_match('/^-[^p]*p(.*)/', $_SERVER['argv'][$i], $matches)) { 63 continue; 60 do { 61 for ($i = 1, $count = count($_SERVER['argv']); $i < $count; ++$i) { 62 if ($_SERVER['argv'][$i] == '-p') { 63 $preloadFileIndex = $i + 1; 64 break 2; 65 } 64 66 } 65 67 66 if (!strlen($matches[1])) { 67 if ($i + 1 < $count) { 68 $file = $_SERVER['argv'][ $i + 1 ]; 69 break; 70 } 71 } else { 72 $file = $matches[1]; 73 break; 74 } 68 return; 69 } while (false); 70 71 if (!array_key_exists($preloadFileIndex, $_SERVER['argv'])) { 72 return; 75 73 } 76 74 77 if (!is_null($file)) { 78 $result = include_once $file; 75 $preloadFile = $_SERVER['argv'][$preloadFileIndex]; 76 if (!is_null($preloadFile)) { 77 $result = include_once $preloadFile; 79 78 if (!$result) { 80 echo "ERROR: Cannot load [ $ file ]. Make sure the file path and permission are correct.\n";79 echo "ERROR: Cannot load [ $preloadFile ]. Make sure the file path and permission are correct.\n"; 81 80 exit(1); 82 81 } -
trunk/bin/testrunner
r165 r168 58 58 function preload() 59 59 { 60 $file = null; 61 for ($i = 1, $count = count($_SERVER['argv']); $i < $count; ++$i) { 62 if (!preg_match('/^-[^p]*p(.*)/', $_SERVER['argv'][$i], $matches)) { 63 continue; 60 do { 61 for ($i = 1, $count = count($_SERVER['argv']); $i < $count; ++$i) { 62 if ($_SERVER['argv'][$i] == '-p') { 63 $preloadFileIndex = $i + 1; 64 break 2; 65 } 64 66 } 65 67 66 if (!strlen($matches[1])) { 67 if ($i + 1 < $count) { 68 $file = $_SERVER['argv'][ $i + 1 ]; 69 break; 70 } 71 } else { 72 $file = $matches[1]; 73 break; 74 } 68 return; 69 } while (false); 70 71 if (!array_key_exists($preloadFileIndex, $_SERVER['argv'])) { 72 return; 75 73 } 76 74 77 if (!is_null($file)) { 78 $result = include_once $file; 75 $preloadFile = $_SERVER['argv'][$preloadFileIndex]; 76 if (!is_null($preloadFile)) { 77 $result = include_once $preloadFile; 79 78 if (!$result) { 80 echo "ERROR: Cannot load [ $ file ]. Make sure the file path and permission are correct.\n";79 echo "ERROR: Cannot load [ $preloadFile ]. Make sure the file path and permission are correct.\n"; 81 80 exit(1); 82 81 } -
trunk/bin/testrunner-st
r165 r168 58 58 function preload() 59 59 { 60 $file = null; 61 for ($i = 1, $count = count($_SERVER['argv']); $i < $count; ++$i) { 62 if (!preg_match('/^-[^p]*p(.*)/', $_SERVER['argv'][$i], $matches)) { 63 continue; 60 do { 61 for ($i = 1, $count = count($_SERVER['argv']); $i < $count; ++$i) { 62 if ($_SERVER['argv'][$i] == '-p') { 63 $preloadFileIndex = $i + 1; 64 break 2; 65 } 64 66 } 65 67 66 if (!strlen($matches[1])) { 67 if ($i + 1 < $count) { 68 $file = $_SERVER['argv'][ $i + 1 ]; 69 break; 70 } 71 } else { 72 $file = $matches[1]; 73 break; 74 } 68 return; 69 } while (false); 70 71 if (!array_key_exists($preloadFileIndex, $_SERVER['argv'])) { 72 return; 75 73 } 76 74 77 if (!is_null($file)) { 78 $result = include_once $file; 75 $preloadFile = $_SERVER['argv'][$preloadFileIndex]; 76 if (!is_null($preloadFile)) { 77 $result = include_once $preloadFile; 79 78 if (!$result) { 80 echo "ERROR: Cannot load [ $ file ]. Make sure the file path and permission are correct.\n";79 echo "ERROR: Cannot load [ $preloadFile ]. Make sure the file path and permission are correct.\n"; 81 80 exit(1); 82 81 }
