~clint-fewbar/ubuntu/precise/php5/php5-5.4-merge

« back to all changes in this revision

Viewing changes to run-tests.php

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-02-22 09:46:37 UTC
  • mfrom: (1.1.20) (0.3.18 sid)
  • Revision ID: package-import@ubuntu.com-20110222094637-nlu2tvb7oqgaarl0
Tags: 5.3.5-1ubuntu1
* Merge from debian/unstable. Remaining changes:
 - debian/control:
    * Dropped firebird2.1-dev, libc-client-dev, libmcrypt-dev as it is in universe.
    * Dropped libmysqlclient15-dev, build against mysql 5.1.
    * Dropped libcurl-dev not in the archive.
    * Suggest php5-suhosin rather than recommends.
    * Dropped php5-imap, php5-interbase, php5-mcrypt since we have versions 
      already in universe.
    * Dropped libonig-dev and libqgdbm since its in universe. (will be re-added in lucid+1)
    * Dropped locales-all.
  - modulelist: Drop imap, interbase, sybase, and mcrypt.
  - debian/rules:
    * Dropped building of mcrypt, imap, and interbase.
    * Install apport hook for php5.
    * stop mysql instance on clean just in case we failed in tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
   +----------------------------------------------------------------------+
25
25
 */
26
26
 
27
 
/* $Id: run-tests.php 293036 2010-01-03 09:23:27Z sebastian $ */
 
27
/* $Id: run-tests.php 305310 2010-11-13 10:18:35Z jani $ */
28
28
 
29
29
/* Sanity check to ensure that pcre extension needed by this script is available.
30
30
 * In the event it is not, print a nice error message indicating that this script will
197
197
if (getenv('TEST_PHP_LOG_FORMAT')) {
198
198
        $log_format = strtoupper(getenv('TEST_PHP_LOG_FORMAT'));
199
199
} else {
200
 
        $log_format = 'LEOD';
 
200
        $log_format = 'LEODS';
201
201
}
202
202
 
203
203
// Check whether a detailed log is wanted.
572
572
                                        if (!$valgrind_header) {
573
573
                                                error("Valgrind returned no version info, cannot proceed.\nPlease check if Valgrind is installed.");
574
574
                                        } else {
575
 
                                                $valgrind_version = preg_replace("/valgrind-([0-9])\.([0-9])\.([0-9]+)([.-]\w+)?(\s+)/", '$1$2$3', $valgrind_header, 1, $replace_count);
 
575
                                                $valgrind_version = preg_replace("/valgrind-([0-9])\.([0-9])\.([0-9]+)([.-\w]+)?(\s+)/", '$1$2$3', $valgrind_header, 1, $replace_count);
576
576
                                                if ($replace_count != 1 || !is_numeric($valgrind_version)) {
577
577
                                                        error("Valgrind returned invalid version info (\"$valgrind_header\"), cannot proceed.");
578
578
                                                }
641
641
                                        $html_output = is_resource($html_file);
642
642
                                        break;
643
643
                                case '--version':
644
 
                                        echo '$Revision: 293036 $' . "\n";
 
644
                                        echo '$Revision: 305310 $' . "\n";
645
645
                                        exit(1);
646
646
 
647
647
                                default:
1352
1352
        $exp_filename      = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'exp';
1353
1353
        $output_filename   = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'out';
1354
1354
        $memcheck_filename = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'mem';
 
1355
        $sh_filename       = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'sh';
1355
1356
        $temp_file         = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
1356
1357
        $test_file         = $test_dir . DIRECTORY_SEPARATOR . $main_file_name . 'php';
1357
1358
        $temp_skipif       = $temp_dir . DIRECTORY_SEPARATOR . $main_file_name . 'skip.php';
1382
1383
                        'exp'  => $exp_filename,
1383
1384
                        'out'  => $output_filename,
1384
1385
                        'mem'  => $memcheck_filename,
 
1386
                        'sh'   => $sh_filename,
1385
1387
                        'php'  => $temp_file,
1386
1388
                        'skip' => $temp_skipif,
1387
1389
                        'clean'=> $temp_clean);
1398
1400
        @unlink($exp_filename);
1399
1401
        @unlink($output_filename);
1400
1402
        @unlink($memcheck_filename);
 
1403
        @unlink($sh_filename);
1401
1404
        @unlink($temp_file);
1402
1405
        @unlink($test_file);
1403
1406
        @unlink($temp_skipif);
1959
1962
                        error("Cannot create test diff - $diff_filename");
1960
1963
                }
1961
1964
 
 
1965
                // write .sh
 
1966
                if (strpos($log_format, 'S') !== false && file_put_contents($sh_filename, b"#!/bin/sh
 
1967
 
 
1968
{$cmd}
 
1969
", FILE_BINARY) === false) {
 
1970
                        error("Cannot create test shell script - $sh_filename");
 
1971
                }
 
1972
                chmod($sh_filename, 0755);
 
1973
 
1962
1974
                // write .log
1963
1975
                if (strpos($log_format, 'L') !== false && file_put_contents($log_filename, b"
1964
1976
---- EXPECTED OUTPUT
2161
2173
                                $settings .= " -d \"$name=$val\"";
2162
2174
                        }
2163
2175
                } else {
2164
 
                        $value = addslashes($value);
 
2176
                        if (substr(PHP_OS, 0, 3) == "WIN" && !empty($value) && $value{0} == '"') {
 
2177
                                $len = strlen($value);
 
2178
 
 
2179
                                if ($value{$len - 1} == '"') {
 
2180
                                        $value{0} = "'";
 
2181
                                        $value{$len - 1} = "'";
 
2182
                                }
 
2183
                        } else {
 
2184
                                $value = addslashes($value);
 
2185
                        }
 
2186
 
2165
2187
                        $settings .= " -d \"$name=$value\"";
2166
2188
                }
2167
2189
        }