Permalink
Browse files

Updates

  • Loading branch information...
1 parent 135f8c5 commit befa6725a43fc7578cc0f7d9108d17ca1eb8de02 Zoe Slattery committed May 9, 2009
View
2 scripts/testfestsource/src/displayresults.php
@@ -33,7 +33,7 @@
$results = file($testfile);
foreach($results as $line) {
- if(preg_match('/^TEST.*([A-Z]{4}).*\[(.*)\]/', $line, $matches)) {
+ if(preg_match('/^TEST.*\s+([A-Z]{4})\s+.*\[(.*)\]/', $line, $matches)) {
$base = substr($matches[2], 0, -5);
$relativename = substr($base, strlen($testRunDir."/".$version."/"));
$publishname = $publishDir."/".$version."/".$relativename;
View
3 scripts/testfestsource/src/failedfilelist.php
@@ -27,7 +27,10 @@
//'php5.2',
);
+
$base = $_GET['basename'];
+$base = preg_replace('#[^a-z_-.]#', '', $base);
+
$_SESSION['basename'] = $base;
$expFile = $base.".exp";
View
6 scripts/testfestsource/src/testfesthourlytest.php
@@ -41,6 +41,9 @@
//copy all the files into a directory thay can be run from
foreach($phpVersion as $dir) {
+ //remove .phpt files from last run, necessary of people have moved things around in SVN.
+ shell_exec("find $testRunDir/$dir -name \"*.phpt\" | xargs -i rm {}");
+
foreach ($filesToCopy as $file) {
$from = trim($svnCheckOutDir."/testfest/".$file);
$destFile = $testSetup->targetFileName($file);
@@ -51,12 +54,11 @@
}
foreach ($phpVersion as $dir) {
+ $testDir = $testRunDir."/".$dir;
$run_tests = $phpBuildDir."/".$dir."/run-tests.php";
$phpExecutable = $phpBuildDir."/".$dir."/sapi/cli/php";
- $testDir = $testRunDir."/".$dir;
echo "$phpExecutable -n $run_tests -n -p $phpExecutable $testDir\n";
$results = shell_exec("$phpExecutable -n $run_tests -n -p $phpExecutable $testDir");
- var_dump ($results);
file_put_contents($testDir."/results", $results);
}
View
16 scripts/testfestsource/src/viewfilecontents.php
@@ -29,14 +29,20 @@
$basename = $_SESSION['basename'];
echo "<br><b>File:".$file."</b><br><br>";
-$contents = file($file);
-foreach($contents as $line) {
- echo "$line<br>";
-}
+$file = realpath($file);
+
+if (strpos($file, '/var/www/html/publishresults/') !== 0) {
+ echo "Test file outside expected path<br />";
+} else {
+ $contents = file($file);
+ foreach($contents as $line) {
+ echo "$line<br />";
+ }
+}
-echo "<br><br><a href=failedfilelist.php?basename=$basename>Back to file list</a><br>";
+echo "<br /><br /><a href='failedfilelist.php?basename=$basename'>Back to file list</a><br />";
?>
</body>

0 comments on commit befa672

Please sign in to comment.