<?php $testdir = dirname(__FILE__); $dp = opendir($testdir); while (($file=readdir($dp))!==false) { if (!preg_match('/\\.php$/',$file)) continue; include_once("$testdir/$file"); } TestResult(__FILE__,1); 0; function TestNote($x,$level=1) { global $TestLevel; while ($TestLevel<$level) { echo '<dl>'; $TestLevel++; } while ($TestLevel>$level) { echo '</dl>'; $TestLevel--; } if ($level>0 && $x>'') echo "<dd>$x</dd>"; else echo $x; } function TestResult($f,$passes,$tests=1) { TestNote('',0); $f = basename($f); $result = ($passes>=$tests) ? 'Pass' : 'Fail'; echo "$f: $result ($passes/$tests)<br />"; } ?>
<?php $mdp = opendir("$testdir/markup"); $tests=0; $passes=0; TestNote(basename(__FILE__),0); while (($mfile=readdir($mdp))!==false) { if (substr($mfile,0,1)=='.') continue; $markup = implode('',file("$testdir/markup/$mfile")); preg_match_all("/=test\\s+(\\S+)\\s+\\[=\n(.*?)\n=\\]\\s*=result\\s+\\[=\n(.*?)=\\]/s",$markup,$match); for($i=0;$i<count($match[1]);$i++) { $out = MarkupToHTML("Test.Markup",$match[2][$i]); $p = ($out==$match[3][$i]); $passes += $p; $tests++; TestNote("$mfile/{$match[1][$i]}: ".(($p) ? 'Pass' : 'Fail')); if (!$p) { TestNote("<pre>out:\n".htmlspecialchars($out)."\nkey:\n". htmlspecialchars($match[3][$i]),2); } } } closedir($mdp); TestResult(__FILE__,$passes,$tests); 0;
} $AgeResult = AgeofUser($user); while ($row = $AgeResult->fetch_assoc()) { $UserAge = $row['age']; } $AgeRange_Result = AgeRange_ResultforUserSalaryPrediction($compname); while ($row = $AgeRange_Result->fetch_assoc()) { $AgeRange = $row['Age_Range']; $APercentage = $row['Percentage']; $temp1 = explode("-", $AgeRange); if ($UserAge > $temp1[0] && $UserAge < $temp1[1]) { $AgeValue = $APercentage; break; } } $TestResult = TestResult($testname, $user); while ($row = $TestResult->fetch_assoc()) { $Total = $row['Total']; $Score = $row['Scores']; } $TestName_Result = TestName_ResultforUserSalaryPrediction($testname, $compname); while ($row = $TestName_Result->fetch_assoc()) { $Testpercentage = $row['Percentage']; } if ($Total !== null) { $testVal = $Score / $Total * $Testpercentage; $flag = 1; } //var_dump($Testpercentage); //echo $testVal; }
$testInfo .= "connectivity=Unknown\r\n"; $testInfo .= "\r\n[runs]\r\n"; file_put_contents("{$testPath}/testinfo.ini", $testInfo); // run the normal workdone processing flow $_REQUEST['id'] = $id; $_REQUEST['done'] = array_key_exists('pending', $_REQUEST) && $_REQUEST['pending'] ? 0 : 1; $_REQUEST['run'] = $run; $_REQUEST['cached'] = 0; $included = true; chdir('./work'); include 'workdone.php'; // re-load the test info $test = GetTestInfo($id); } // Return the test ID (or redirect if not using the API) TestResult($test, $error); } else { // Invalid API key = block if keys are configured (for now anyway) header('HTTP/1.0 403 Forbidden'); echo 'Access Denied. Invalid API Key'; } /**************************************************************************** * Display the import UI ****************************************************************************/ } else { $page_keywords = array('Import', 'Chrome Dev Tools', 'Webpagetest', 'Website Speed Test', 'Page Speed'); $page_description = "Import Chrome Dev Tools."; ?> <!DOCTYPE html> <html> <head>
function TestCase5() { global $port; echo "\n\nTest Case 5 : Multiple Log Test with 2 machines close\nLog : Hello How Are You Today\n\n\n\n"; setupTest(5); connectNode(0); tryCommand("Hello"); sleep(1); tryCommand("How"); sleep(1); connectNode(0); tryCommand("quit"); connectNode(1); sleep(1); tryCommand("Are"); sleep(1); connectNode(2); tryCommand("quit"); connectNode(1); sleep(1); tryCommand("You"); sleep(1); tryCommand("Today"); sleep(1); CloseAll(5); TestResult(5); $port += 5; }