Find file
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (41 sloc) 1.73 KB
* This is experimental code designed to run suites of tests in parallel. The tests within each directory are run in sequence,
* the diretcories (test-suites?) are run in parallel. The only command line argument is the number of
* processes. The rest of the set up is done in the first few lines of code with hard-coded paths.
* Note: will only work on Linux. ./confgure --with-pcntl.
$testdir = "/mnt/workspace/PHP/php53"; //going to run all the tests under thi dir.
$out_p = "/tmp/test_p";
$out_s = "/tmp/test_s";
$maxp = $argv[1];
echo "$maxp\n";
$run = new PhpTestRun($testdir, $php_executable, $run_tests);
$list = $run->get_directory_list();
$nsdir = count($list);
echo "Total subdirectories = $nsdir\n\n";
echo "Number of sub-directories with tests = ".count($test_list)."\n";
echo "Max processes for this run = $f\n";
$start_time = getMicrotime();
$after_p_time = getMicrotime();
$ptime = $after_p_time - $start_time;
$stime = $after_s_time - $after_p_time;
CompareResults::compare($test_list, $out_p, $out_s, $testdir);
echo "Time to run tests in parallel = $ptime\nTime to run tests in sequence = $stime\n";
function getMicrotime(){
list($useg,$seg)=explode(' ',microtime());
return ((float)$useg+(float)$seg);