cvs: php-gcov-web(SOC06) /cron config.php cron.php cron.sh make-index.php system.php tags.inc tests.php
| From: | Daniel Pronych | Date: | Mon, 14 Aug 2006 22:38:08 +0000 |
| Subject: | cvs: php-gcov-web(SOC06) /cron config.php cron.php cron.sh make-index.php system.php tags.inc tests.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-32161@lists.php.net to get a copy of this message | ||
pronych Mon Aug 14 22:38:08 2006 UTC
Removed files: (Branch: SOC06)
/php-gcov-web/cron make-index.php
Modified files:
/php-gcov-web/cron config.php cron.php cron.sh system.php tags.inc
tests.php
Log:
Initial submission of new tag format and cron script
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/config.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/cron/config.php diff -u php-gcov-web/cron/config.php:1.1.2.2 php-gcov-web/cron/config.php:1.1.2.3 --- php-gcov-web/cron/config.php:1.1.2.2 Sun Aug 13 22:49:35 2006 +++ php-gcov-web/cron/config.php Mon Aug 14 22:38:08 2006 @@ -7,7 +7,7 @@ // If is_master = true; after build, stores the outcome locally // If is_master = false; after build, sends data to remote server // Note: if is_master = false; a valid user and pass is required -$is_master = true; +$is_master = false; // Note: these options are specific to is_master = false $server_submit_url = 'http://gcov.aristotle.dlitz.net/post.php'; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-gcov-web/cron/cron.php diff -u php-gcov-web/cron/cron.php:1.1.2.4 php-gcov-web/cron/cron.php:1.1.2.5 --- php-gcov-web/cron/cron.php:1.1.2.4 Sun Aug 13 22:49:35 2006 +++ php-gcov-web/cron/cron.php Mon Aug 14 22:38:08 2006 @@ -24,10 +24,14 @@ $totalnumleaks = 0; // Total number of memory leaks (valgrind.php) $totalnumfailures = 0; // Total number of test failures (tests.php) -$linkerinfo = 'N/A'; // Information regarding linker (system.php) +$configureinfo = 'N/A'; // Information regarding configure (system.php) + $compilerinfo = 'N/A'; // Information regarding compiler (system.php) + $osinfo = 'N/A'; // Information regarding operating system (system.php) +$valgrindinfo = 'N/A'; // Information regarding valgrind (system.php) + $codecoverage_percent = -1; // Information regarding the code coverage $version_id = 0; // Start by assuming the version_id is unknown @@ -181,14 +185,15 @@ <build> <buildinfo> -<username>johndoe</username> +<username>$server_submit_user</username> <version>$phpver</version> <buildstatus>$makestatus</buildstatus> <buildtime>$build_time</buildtime> <codecoverage>$codecoverage_percent</codecoverage> <compiler>$compilerinfo</compiler> -<linker>$linkerinfo</linker> +<configure>$configureinfo</configure> <os>$osinfo</os> +<valgrind>$valgrindinfo</valgrind> </buildinfo> <builddata> XML; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.sh?r1=1.1.2.5&r2=1.1.2.6&diff_format=u Index: php-gcov-web/cron/cron.sh diff -u php-gcov-web/cron/cron.sh:1.1.2.5 php-gcov-web/cron/cron.sh:1.1.2.6 --- php-gcov-web/cron/cron.sh:1.1.2.5 Wed Aug 9 23:16:53 2006 +++ php-gcov-web/cron/cron.sh Mon Aug 14 22:38:08 2006 @@ -3,58 +3,78 @@ export LC_ALL=C # file that contains the PHP version tags -filename=tags.inc - -# the maximum number of elements for a single php version -php_max_version_elements=4 +FILENAME=tags.inc WORKDIR=`dirname "$0"` echo "$WORKDIR" | grep -q '^/' || WORKDIR="`pwd`/$WORKDIR" # get absolute path -. ${WORKDIR}/config.sh - # set up a one dimensional array to store all php version information -declare -a php_version_array -php_version_array=( `cat "$filename"` ) +declare -a TAGS_ARRAY +TAGS_ARRAY=( `cat "$FILENAME"` ) # Calculate how many elements there are in a php version array -php_version_totalcount=${#php_version_array[@]} +TAGS_COUNT=${#TAGS_ARRAY[@]} + +PHPROOT=${TAGS_ARRAY[0]} +OUTROOT=${TAGS_ARRAY[1]} + +# Check for a build version passed to the script +if [ $# -eq 1 ]; then + BUILD=$1 +else + BUILD="_all_" +fi # loop through each PHP version and perform the required builds -for (( i = 0 ; i < ${php_version_totalcount} ; i += ${php_max_version_elements} )) +for (( i = 2 ; i < $TAGS_COUNT ; i += 1 )) do - #set up the php version information - echo ${php_version_array[i]} - PHPVERSION=${php_version_array[i]} - echo ${php_version_array[i+1]} - PHPSRC=${php_version_array[i+1]} - echo ${php_version_array[i+2]} - TMPDIR=${php_version_array[i+2]} - echo ${php_version_array[i+3]} - OUTDIR=${php_version_array[i+3]} - - # run the loop for each php version - cd ${PHPSRC} - ./cvsclean - cvs -q up - ./buildconf - ./config.nice - - #test for success of the make operation - if ( make > /dev/null 2> ${TMPDIR}/php_build.log ); then - MAKESTATUS=pass - - export TEST_PHP_ARGS="-m -U -n -q --keep-all" - - make lcov > ${TMPDIR}/php_test.log - mv lcov_html ${OUTDIR} - php ${WORKDIR}/valgrind.php ${TMPDIR} ${OUTDIR} ${PHPSRC} + PHPTAG=${TAGS_ARRAY[i]} - echo "make successful" + # Build all has no exceptions + if [ $BUILD = "_all_" ]; then + BUILD_VERSION=1 else - MAKESTATUS=fail - echo "make failed" + if [ $BUILD = $PHPTAG ]; then + BUILD_VERSION=1 + #todo: if tag does not exist, output error + else + BUILD_VERSION=0 + fi fi - php ${WORKDIR}/cron.php ${TMPDIR} ${OUTDIR} ${PHPSRC} ${MAKESTATUS} ${PHPVERSION} + # If this version should be built + if [ $BUILD_VERSION = 1 ]; then + + # todo: make sure all the following directories exist + OUTDIR=${OUTROOT}/${PHPTAG} + PHPSRC=${PHPROOT}/${PHPTAG} + TMPDIR=${PHPROOT}/tmp/${PHPTAG} + + cd ${PHPSRC} + ./cvsclean + cvs -q up + ./buildconf + ./config.nice + + if ( make > /dev/null 2> ${TMPDIR}/php_build.log ); then + + #test for success of the make operation + MAKESTATUS=pass + + export TEST_PHP_ARGS="-m -U -n -q --keep-all" + + # LCOV operations + make lcov > ${TMPDIR}/php_test.log + rm -r ${OUTDIR}/lcov_html + mv lcov_html ${OUTDIR} + + echo "make successful" + else + MAKESTATUS=fail + echo "make failed" + fi # End build failure or success + + php ${WORKDIR}/cron.php ${TMPDIR} ${OUTDIR} ${PHPSRC} ${MAKESTATUS} ${PHPTAG} + + fi # End verify build PHP version done http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/system.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/cron/system.php diff -u php-gcov-web/cron/system.php:1.1.2.2 php-gcov-web/cron/system.php:1.1.2.3 --- php-gcov-web/cron/system.php:1.1.2.2 Tue Aug 8 18:03:04 2006 +++ php-gcov-web/cron/system.php Mon Aug 14 22:38:08 2006 @@ -3,23 +3,29 @@ $write = html_header('System Info'); // configure (linker?) -$write .= "<h2>Configure used:</h2>\n"; +$write .= "<h2>Configure Used:</h2>\n"; $config = file("$phpdir/config.nice"); $config = array_slice($config, 4); //remove inital comments -$linkerinfo = implode('', $config); -$write .= "<pre>".$linkerinfo."</pre>\n"; +$configureinfo = implode('', $config); +$write .= "<pre>".$configureinfo."</pre>\n"; -// compiler -$write .= "<h2>Compiler used</h2>\n"; -$compiler = explode("\n", `gcc --version`); +// Compiler +$write .= "<h2>Compiler Used:</h2>\n"; +$compiler = explode("\n", `cc --version`); $compilerinfo = $compiler[0]; $write .= '<p>'.$compilerinfo. "</p>\n"; // OS +// todo:os info should work for Windows and other systems without uname $write .= "<h2>Operating System:</h2>\n"; $osinfo = `uname -srmi`; $write .= '<p>'.$osinfo."</p>\n"; +// Valgrind (calculated but not displayed) +$valgrind = explode("\n", `valgrind --version`); +$valgrindinfo = $valgrind[0]; + + $write .= html_footer(); file_put_contents("$outdir/system.inc", $write); http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/tags.inc?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/cron/tags.inc diff -u php-gcov-web/cron/tags.inc:1.1.2.2 php-gcov-web/cron/tags.inc:1.1.2.3 --- php-gcov-web/cron/tags.inc:1.1.2.2 Tue Aug 8 18:03:04 2006 +++ php-gcov-web/cron/tags.inc Mon Aug 14 22:38:08 2006 @@ -1,5 +1,6 @@ -PHP_4_4 /home/quadra23/temp/PHP_4_4 /home/quadra23/temp/tmp/PHP_4_4 /var/local/gcov/www/PHP_4_4 -PHP_5_1 /home/quadra23/temp/PHP_5_1 /home/quadra23/temp/tmp/PHP_5_1 /var/local/gcov/www/PHP_5_1 -PHP_5_2 /home/quadra23/temp/PHP_5_2 /home/quadra23/temp/tmp/PHP_5_2 /var/local/gcov/www/PHP_5_2 -PHP_5_E /home/quadra23/temp/PHP_5_E /home/quadra23/temp/tmp/PHP_5_E /var/local/gcov/www/PHP_5_E -PHP_HEAD /home/quadra23/temp/PHP_HEAD /home/quadra23/temp/tmp/PHP_HEAD /var/local/gcov/www/PHP_HEAD +/home/quadra23/temp +/var/local/gcov/www +PHP_4_4 +PHP_5_1 +PHP_5_2 +PHP_HEAD http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/tests.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-gcov-web/cron/tests.php diff -u php-gcov-web/cron/tests.php:1.1.2.4 php-gcov-web/cron/tests.php:1.1.2.5 --- php-gcov-web/cron/tests.php:1.1.2.4 Sun Aug 13 22:49:35 2006 +++ php-gcov-web/cron/tests.php Mon Aug 14 22:38:08 2006 @@ -24,7 +24,6 @@ $old_dir = ''; - // A single failure is enough to verify that a failure occurred if (preg_match($fail_re, $data) < 1) { @@ -51,19 +50,19 @@ // Note: that the following period is preserved $base = "$phpdir/".substr($test['file'],0,-4); - $t = array(); - $t['script'] = file_get_contents($base.'php') - or $t['script'] = 'Script contents not available.'; + $newtest = array(); + $newtest['script'] = file_get_contents($base.'php') + or $newtest['script'] = 'Script contents not available.'; if((isset($test['testtype'])) && (strtolower($test['testtype']) == 'u')) { - $t['testtype'] = 'Unicode'; + $newtest['testtype'] = 'Unicode'; $base .= 'u.'; } else { - $t['testtype'] = 'Native'; + $newtest['testtype'] = 'Native'; } // Note: the hash reflects the exact filename for native @@ -72,22 +71,22 @@ if(strtolower($status) == 'fail') { - $t['status'] = 'fail'; - $t['file'] = $test['file']; - $t['expected'] = file_get_contents($base.'exp') - or $t['expected'] = 'N\A'; - $t['output'] = file_get_contents($base.'out') - or $t['output'] = 'N\A'; - $t['difference'] = file_get_contents($base.'diff') - or $t['difference'] = 'N\A'; + $newtest['status'] = 'fail'; + $newtest['file'] = $test['file']; + $newtest['expected'] = file_get_contents($base.'exp') + or $newtest['expected'] = 'N\A'; + $newtest['output'] = file_get_contents($base.'out') + or $newtest['output'] = 'N\A'; + $newtest['difference'] = file_get_contents($base.'diff') + or $newtest['difference'] = 'N\A'; } else // status == 'PASS' { - $t['status'] = 'pass'; - $t['file'] = $test['file']; + $newtest['status'] = 'pass'; + $newtest['file'] = $test['file']; } - $xmlarray['tests'][] = $t; + $xmlarray['tests'][] = $newtest; // This loop writes the content for a failed test if(strtolower($status) == 'fail') @@ -99,17 +98,17 @@ $write .= "<tr><td colspan='3' align='center'><b>$dir</b></td></tr>\n"; } - $write .= "<tr><td><a href='viewer.php?version=$version&func=tests&file=$hash'>$file</a></td><td>{$t['testtype']}</td><td>$title</td></tr>\n"; + $write .= "<tr><td><a href='viewer.php?version=$version&func=tests&file=$hash'>$file</a></td><td>{$newtest['testtype']}</td><td>$title</td></tr>\n"; $additional = "<h2>Script</h2><pre>\n" - .highlight_string($t['script'], true) + .highlight_string($newtest['script'], true) ."\n</pre><h2>Expected</h2><pre>\n" - .htmlspecialchars($t['expected']) + .htmlspecialchars($newtest['expected']) ."\n</pre><h2>Output</h2><pre>\n" - .htmlspecialchars(str_replace($phpdir,'',$t['output'])) + .htmlspecialchars(str_replace($phpdir,'',$newtest['output'])) ."\n</pre><h2>Diff</h2><pre>\n" - .htmlspecialchars(str_replace($phpdir,'',$t['difference']))."\n</pre>"; + .htmlspecialchars(str_replace($phpdir,'',$newtest['difference']))."\n</pre>"; // now create the Page for the test file_put_contents("$outdir/$hash.inc",
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/config.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/cron/config.php diff -u php-gcov-web/cron/config.php:1.1.2.2 php-gcov-web/cron/config.php:1.1.2.3 --- php-gcov-web/cron/config.php:1.1.2.2 Sun Aug 13 22:49:35 2006 +++ php-gcov-web/cron/config.php Mon Aug 14 22:38:08 2006 @@ -7,7 +7,7 @@ // If is_master = true; after build, stores the outcome locally // If is_master = false; after build, sends data to remote server // Note: if is_master = false; a valid user and pass is required -$is_master = true; +$is_master = false; // Note: these options are specific to is_master = false $server_submit_url = 'http://gcov.aristotle.dlitz.net/post.php'; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-gcov-web/cron/cron.php diff -u php-gcov-web/cron/cron.php:1.1.2.4 php-gcov-web/cron/cron.php:1.1.2.5 --- php-gcov-web/cron/cron.php:1.1.2.4 Sun Aug 13 22:49:35 2006 +++ php-gcov-web/cron/cron.php Mon Aug 14 22:38:08 2006 @@ -24,10 +24,14 @@ $totalnumleaks = 0; // Total number of memory leaks (valgrind.php) $totalnumfailures = 0; // Total number of test failures (tests.php) -$linkerinfo = 'N/A'; // Information regarding linker (system.php) +$configureinfo = 'N/A'; // Information regarding configure (system.php) + $compilerinfo = 'N/A'; // Information regarding compiler (system.php) + $osinfo = 'N/A'; // Information regarding operating system (system.php) +$valgrindinfo = 'N/A'; // Information regarding valgrind (system.php) + $codecoverage_percent = -1; // Information regarding the code coverage $version_id = 0; // Start by assuming the version_id is unknown @@ -181,14 +185,15 @@ <build> <buildinfo> -<username>johndoe</username> +<username>$server_submit_user</username> <version>$phpver</version> <buildstatus>$makestatus</buildstatus> <buildtime>$build_time</buildtime> <codecoverage>$codecoverage_percent</codecoverage> <compiler>$compilerinfo</compiler> -<linker>$linkerinfo</linker> +<configure>$configureinfo</configure> <os>$osinfo</os> +<valgrind>$valgrindinfo</valgrind> </buildinfo> <builddata> XML; http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/cron.sh?r1=1.1.2.5&r2=1.1.2.6&diff_format=u Index: php-gcov-web/cron/cron.sh diff -u php-gcov-web/cron/cron.sh:1.1.2.5 php-gcov-web/cron/cron.sh:1.1.2.6 --- php-gcov-web/cron/cron.sh:1.1.2.5 Wed Aug 9 23:16:53 2006 +++ php-gcov-web/cron/cron.sh Mon Aug 14 22:38:08 2006 @@ -3,58 +3,78 @@ export LC_ALL=C # file that contains the PHP version tags -filename=tags.inc - -# the maximum number of elements for a single php version -php_max_version_elements=4 +FILENAME=tags.inc WORKDIR=`dirname "$0"` echo "$WORKDIR" | grep -q '^/' || WORKDIR="`pwd`/$WORKDIR" # get absolute path -. ${WORKDIR}/config.sh - # set up a one dimensional array to store all php version information -declare -a php_version_array -php_version_array=( `cat "$filename"` ) +declare -a TAGS_ARRAY +TAGS_ARRAY=( `cat "$FILENAME"` ) # Calculate how many elements there are in a php version array -php_version_totalcount=${#php_version_array[@]} +TAGS_COUNT=${#TAGS_ARRAY[@]} + +PHPROOT=${TAGS_ARRAY[0]} +OUTROOT=${TAGS_ARRAY[1]} + +# Check for a build version passed to the script +if [ $# -eq 1 ]; then + BUILD=$1 +else + BUILD="_all_" +fi # loop through each PHP version and perform the required builds -for (( i = 0 ; i < ${php_version_totalcount} ; i += ${php_max_version_elements} )) +for (( i = 2 ; i < $TAGS_COUNT ; i += 1 )) do - #set up the php version information - echo ${php_version_array[i]} - PHPVERSION=${php_version_array[i]} - echo ${php_version_array[i+1]} - PHPSRC=${php_version_array[i+1]} - echo ${php_version_array[i+2]} - TMPDIR=${php_version_array[i+2]} - echo ${php_version_array[i+3]} - OUTDIR=${php_version_array[i+3]} - - # run the loop for each php version - cd ${PHPSRC} - ./cvsclean - cvs -q up - ./buildconf - ./config.nice - - #test for success of the make operation - if ( make > /dev/null 2> ${TMPDIR}/php_build.log ); then - MAKESTATUS=pass - - export TEST_PHP_ARGS="-m -U -n -q --keep-all" - - make lcov > ${TMPDIR}/php_test.log - mv lcov_html ${OUTDIR} - php ${WORKDIR}/valgrind.php ${TMPDIR} ${OUTDIR} ${PHPSRC} + PHPTAG=${TAGS_ARRAY[i]} - echo "make successful" + # Build all has no exceptions + if [ $BUILD = "_all_" ]; then + BUILD_VERSION=1 else - MAKESTATUS=fail - echo "make failed" + if [ $BUILD = $PHPTAG ]; then + BUILD_VERSION=1 + #todo: if tag does not exist, output error + else + BUILD_VERSION=0 + fi fi - php ${WORKDIR}/cron.php ${TMPDIR} ${OUTDIR} ${PHPSRC} ${MAKESTATUS} ${PHPVERSION} + # If this version should be built + if [ $BUILD_VERSION = 1 ]; then + + # todo: make sure all the following directories exist + OUTDIR=${OUTROOT}/${PHPTAG} + PHPSRC=${PHPROOT}/${PHPTAG} + TMPDIR=${PHPROOT}/tmp/${PHPTAG} + + cd ${PHPSRC} + ./cvsclean + cvs -q up + ./buildconf + ./config.nice + + if ( make > /dev/null 2> ${TMPDIR}/php_build.log ); then + + #test for success of the make operation + MAKESTATUS=pass + + export TEST_PHP_ARGS="-m -U -n -q --keep-all" + + # LCOV operations + make lcov > ${TMPDIR}/php_test.log + rm -r ${OUTDIR}/lcov_html + mv lcov_html ${OUTDIR} + + echo "make successful" + else + MAKESTATUS=fail + echo "make failed" + fi # End build failure or success + + php ${WORKDIR}/cron.php ${TMPDIR} ${OUTDIR} ${PHPSRC} ${MAKESTATUS} ${PHPTAG} + + fi # End verify build PHP version done http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/system.php?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/cron/system.php diff -u php-gcov-web/cron/system.php:1.1.2.2 php-gcov-web/cron/system.php:1.1.2.3 --- php-gcov-web/cron/system.php:1.1.2.2 Tue Aug 8 18:03:04 2006 +++ php-gcov-web/cron/system.php Mon Aug 14 22:38:08 2006 @@ -3,23 +3,29 @@ $write = html_header('System Info'); // configure (linker?) -$write .= "<h2>Configure used:</h2>\n"; +$write .= "<h2>Configure Used:</h2>\n"; $config = file("$phpdir/config.nice"); $config = array_slice($config, 4); //remove inital comments -$linkerinfo = implode('', $config); -$write .= "<pre>".$linkerinfo."</pre>\n"; +$configureinfo = implode('', $config); +$write .= "<pre>".$configureinfo."</pre>\n"; -// compiler -$write .= "<h2>Compiler used</h2>\n"; -$compiler = explode("\n", `gcc --version`); +// Compiler +$write .= "<h2>Compiler Used:</h2>\n"; +$compiler = explode("\n", `cc --version`); $compilerinfo = $compiler[0]; $write .= '<p>'.$compilerinfo. "</p>\n"; // OS +// todo:os info should work for Windows and other systems without uname $write .= "<h2>Operating System:</h2>\n"; $osinfo = `uname -srmi`; $write .= '<p>'.$osinfo."</p>\n"; +// Valgrind (calculated but not displayed) +$valgrind = explode("\n", `valgrind --version`); +$valgrindinfo = $valgrind[0]; + + $write .= html_footer(); file_put_contents("$outdir/system.inc", $write); http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/tags.inc?r1=1.1.2.2&r2=1.1.2.3&diff_format=u Index: php-gcov-web/cron/tags.inc diff -u php-gcov-web/cron/tags.inc:1.1.2.2 php-gcov-web/cron/tags.inc:1.1.2.3 --- php-gcov-web/cron/tags.inc:1.1.2.2 Tue Aug 8 18:03:04 2006 +++ php-gcov-web/cron/tags.inc Mon Aug 14 22:38:08 2006 @@ -1,5 +1,6 @@ -PHP_4_4 /home/quadra23/temp/PHP_4_4 /home/quadra23/temp/tmp/PHP_4_4 /var/local/gcov/www/PHP_4_4 -PHP_5_1 /home/quadra23/temp/PHP_5_1 /home/quadra23/temp/tmp/PHP_5_1 /var/local/gcov/www/PHP_5_1 -PHP_5_2 /home/quadra23/temp/PHP_5_2 /home/quadra23/temp/tmp/PHP_5_2 /var/local/gcov/www/PHP_5_2 -PHP_5_E /home/quadra23/temp/PHP_5_E /home/quadra23/temp/tmp/PHP_5_E /var/local/gcov/www/PHP_5_E -PHP_HEAD /home/quadra23/temp/PHP_HEAD /home/quadra23/temp/tmp/PHP_HEAD /var/local/gcov/www/PHP_HEAD +/home/quadra23/temp +/var/local/gcov/www +PHP_4_4 +PHP_5_1 +PHP_5_2 +PHP_HEAD http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/tests.php?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-gcov-web/cron/tests.php diff -u php-gcov-web/cron/tests.php:1.1.2.4 php-gcov-web/cron/tests.php:1.1.2.5 --- php-gcov-web/cron/tests.php:1.1.2.4 Sun Aug 13 22:49:35 2006 +++ php-gcov-web/cron/tests.php Mon Aug 14 22:38:08 2006 @@ -24,7 +24,6 @@ $old_dir = ''; - // A single failure is enough to verify that a failure occurred if (preg_match($fail_re, $data) < 1) { @@ -51,19 +50,19 @@ // Note: that the following period is preserved $base = "$phpdir/".substr($test['file'],0,-4); - $t = array(); - $t['script'] = file_get_contents($base.'php') - or $t['script'] = 'Script contents not available.'; + $newtest = array(); + $newtest['script'] = file_get_contents($base.'php') + or $newtest['script'] = 'Script contents not available.'; if((isset($test['testtype'])) && (strtolower($test['testtype']) == 'u')) { - $t['testtype'] = 'Unicode'; + $newtest['testtype'] = 'Unicode'; $base .= 'u.'; } else { - $t['testtype'] = 'Native'; + $newtest['testtype'] = 'Native'; } // Note: the hash reflects the exact filename for native @@ -72,22 +71,22 @@ if(strtolower($status) == 'fail') { - $t['status'] = 'fail'; - $t['file'] = $test['file']; - $t['expected'] = file_get_contents($base.'exp') - or $t['expected'] = 'N\A'; - $t['output'] = file_get_contents($base.'out') - or $t['output'] = 'N\A'; - $t['difference'] = file_get_contents($base.'diff') - or $t['difference'] = 'N\A'; + $newtest['status'] = 'fail'; + $newtest['file'] = $test['file']; + $newtest['expected'] = file_get_contents($base.'exp') + or $newtest['expected'] = 'N\A'; + $newtest['output'] = file_get_contents($base.'out') + or $newtest['output'] = 'N\A'; + $newtest['difference'] = file_get_contents($base.'diff') + or $newtest['difference'] = 'N\A'; } else // status == 'PASS' { - $t['status'] = 'pass'; - $t['file'] = $test['file']; + $newtest['status'] = 'pass'; + $newtest['file'] = $test['file']; } - $xmlarray['tests'][] = $t; + $xmlarray['tests'][] = $newtest; // This loop writes the content for a failed test if(strtolower($status) == 'fail') @@ -99,17 +98,17 @@ $write .= "<tr><td colspan='3' align='center'><b>$dir</b></td></tr>\n"; } - $write .= "<tr><td><a href='viewer.php?version=$version&func=tests&file=$hash'>$file</a></td><td>{$t['testtype']}</td><td>$title</td></tr>\n"; + $write .= "<tr><td><a href='viewer.php?version=$version&func=tests&file=$hash'>$file</a></td><td>{$newtest['testtype']}</td><td>$title</td></tr>\n"; $additional = "<h2>Script</h2><pre>\n" - .highlight_string($t['script'], true) + .highlight_string($newtest['script'], true) ."\n</pre><h2>Expected</h2><pre>\n" - .htmlspecialchars($t['expected']) + .htmlspecialchars($newtest['expected']) ."\n</pre><h2>Output</h2><pre>\n" - .htmlspecialchars(str_replace($phpdir,'',$t['output'])) + .htmlspecialchars(str_replace($phpdir,'',$newtest['output'])) ."\n</pre><h2>Diff</h2><pre>\n" - .htmlspecialchars(str_replace($phpdir,'',$t['difference']))."\n</pre>"; + .htmlspecialchars(str_replace($phpdir,'',$newtest['difference']))."\n</pre>"; // now create the Page for the test file_put_contents("$outdir/$hash.inc",