svn: /web/php-gcov/trunk/ cron/tests.php www/config.php www/expected_tests.php www/viewer.php

From: Date: Wed, 07 Sep 2011 21:39:48 +0000
Subject: svn: /web/php-gcov/trunk/ cron/tests.php www/config.php www/expected_tests.php www/viewer.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-12147@lists.php.net to get a copy of this message
felipe Wed, 07 Sep 2011 21:39:48 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=316385 Log: - Make a separated page to XFAIL results Changed paths: U web/php-gcov/trunk/cron/tests.php U web/php-gcov/trunk/www/config.php A web/php-gcov/trunk/www/expected_tests.php U web/php-gcov/trunk/www/viewer.php Modified: web/php-gcov/trunk/cron/tests.php =================================================================== --- web/php-gcov/trunk/cron/tests.php 2011-09-07 19:19:00 UTC (rev 316384) +++ web/php-gcov/trunk/cron/tests.php 2011-09-07 21:39:48 UTC (rev 316385) @@ -23,6 +23,7 @@ // Tests generation file // $data: contains the contents of $tmpdir/php_test.log +$xfail_tests = array(); $fail_tests = array(); $skip_tests = array(); $valgrind = array(); @@ -49,8 +50,12 @@ $script = @file_get_contents($base.'php'); ++$totalnumfailures; - - $fail_tests[$test['file']] = array($title, $difference, $expected, $output, $script); + + if (strpos($status, 'XFAIL') !== false) { + $xfail_tests[$test['file']] = array($title, $difference, $expected, $output, $script); + } else { + $fail_tests[$test['file']] = array($title, $difference, $expected, $output, $script); + } } if (strpos($status, 'LEAK') !== false) { @@ -71,6 +76,7 @@ // sort by filename ksort($skip_tests); ksort($fail_tests); +ksort($xfail_tests); ksort($valgrind); $totalnumleaks = count($valgrind); @@ -78,4 +84,5 @@ // now write the raw data to thw www dir file_put_contents("$outdir/skip.inc", serialize($skip_tests)); file_put_contents("$outdir/fail.inc", serialize($fail_tests)); +file_put_contents("$outdir/xfail.inc", serialize($xfail_tests)); file_put_contents("$outdir/valgrind.inc", serialize($valgrind)); Modified: web/php-gcov/trunk/www/config.php =================================================================== --- web/php-gcov/trunk/www/config.php 2011-09-07 19:19:00 UTC (rev 316384) +++ web/php-gcov/trunk/www/config.php 2011-09-07 21:39:48 UTC (rev 316385) @@ -43,6 +43,7 @@ 'graphs' => 'graph', 'parameter-parsing' => 'params', 'test-failures' => 'tests', + 'expected-test-failures' => 'expected_tests', 'valgrind' => 'valgrind', 'skipped-tests' => 'skip', 'tested-functions' => 'tested_functions', @@ -54,6 +55,7 @@ 'compile-results' => 'compile_results', 'system' => 'system', 'test-failures' => 'tests', + 'expected-test-failures' => 'expected_tests', 'valgrind' => 'valgrind' ); Added: web/php-gcov/trunk/www/expected_tests.php =================================================================== --- web/php-gcov/trunk/www/expected_tests.php (rev 0) +++ web/php-gcov/trunk/www/expected_tests.php 2011-09-07 21:39:48 UTC (rev 316385) @@ -0,0 +1,108 @@ +<?php +/* + +----------------------------------------------------------------------+ + | PHP QA GCOV Website | + +----------------------------------------------------------------------+ + | Copyright (c) 2005-2006 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Nuno Lopes <nlopess@php.net> | + +----------------------------------------------------------------------+ +*/ + +/* $Id: tests.php 261059 2008-06-11 17:50:36Z nlopess $ */ + +if (!defined('IN_GCOV_CODE')) exit; + +$inputfile = "./$version/xfail.inc"; +$raw_data = @file_get_contents($inputfile); +$data = unserialize($raw_data); + + +if (!$raw_data) { + $content = "<p>Sorry, but this data isn't available at this time.</p>"; + return; + +} elseif (isset($_GET['file'])) { + $file = $_GET['file']; + + if (isset($data[$file])) { + $data = $data[$file]; + $file = htmlspecialchars($file); + $title = htmlspecialchars($data[0]); + $diff = htmlspecialchars($data[1]); + $exp = htmlspecialchars($data[2]); + $output = htmlspecialchars($data[3]); + $script = highlight_php_numbered($data[4]); + + $appvars['page']['title'] = "PHP: $version Expected Test Failure Report for $file"; + $appvars['page']['head'] = "Expected Test Failure Report for $file ('$title')"; + + $content = <<< HTML +<h2>Script</h2> +$script +<h2>Expected</h2> +<pre>$exp</pre> +<h2>Output</h2> +<pre>$output</pre> +<h2>Diff</h2> +<pre>$diff</pre> +HTML; + + } else { + $content = "<p>Invalid file ID.</p>\n"; + } + +} elseif ($data) { + + $content = '<p><b>'.count($data) . " tests failed:</b></p>\n"; + $old_dir = ''; + + $content .= <<< HTML +<table border="1"> +HTML; + + foreach ($data as $path => $entry) { + $dir = htmlspecialchars(dirname($path)); + $file = htmlspecialchars(basename($path)); + $urlfile = htmlspecialchars(urlencode($path)); + $title = htmlspecialchars($entry[0]); + + if ($dir !== $old_dir) { + $old_dir = $dir; + $content .= <<< HTML +<tr> + <td colspan="3" align="center"><b>$dir</b></td> +</tr> +<tr> + <td><b>File</b></td> + <td><b>Name</b></td> +</tr> +HTML; + } + + $content .= <<< HTML +<tr> + <td><a href="/viewer.php?version=$version&amp;func=expected_tests&amp;file=$urlfile">$file</a></td> + <td>$title</td> +</tr> +HTML; + + } + + $content .= <<< HTML +</table> +HTML; + +} else { + $content = "<p>Congratulations! Currently there are no test failures!</p>\n"; +} + +$content .= footer_timestamp(@filemtime($inputfile)); Modified: web/php-gcov/trunk/www/viewer.php =================================================================== --- web/php-gcov/trunk/www/viewer.php 2011-09-07 19:19:00 UTC (rev 316384) +++ web/php-gcov/trunk/www/viewer.php 2011-09-07 21:39:48 UTC (rev 316385) @@ -98,6 +98,11 @@ 'pagetitle' => 'PHP: Test Failures for '.$version, 'pagehead' => 'Test Failures' ), + 'expected_tests' => + array( + 'pagetitle' => 'PHP: Expected Test Failures for '.$version, + 'pagehead' => 'Expected Test Failures' + ), 'valgrind' => array( 'pagetitle' => 'PHP: Valgrind Reports for '.$version,

« previous php.webmaster (#12147) next »