com php-src: Fix run-tests.php with Valgrind >= 3.1 0.0.: run-tests.php
| From: | Adam Harvey | Date: | Thu, 22 May 2014 22:37:08 +0000 |
| Subject: | com php-src: Fix run-tests.php with Valgrind >= 3.1 0.0.: run-tests.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78500@lists.php.net to get a copy of this message | ||
Commit: 5d1bfd6fbfbb1474b23b0b58ef81f8396b361fca
Author: Adam Harvey <aharvey@php.net> Thu, 22 May 2014 22:36:55 +0000
Parents: fdb2709dd27c5987c2d2c8aaf0cdbebf9f17f643
Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5d1bfd6fbfbb1474b23b0b58ef81f8396b361fca
Log:
Fix run-tests.php with Valgrind >= 3.10.0.
The version test that we had in run-tests.php assumed that the major and minor
version numbers were always single digits. This removes that assumption and
also uses version_compare() for the comparison instead of naively converting it
to an integer.
Changed paths:
M run-tests.php
Diff:
diff --git a/run-tests.php b/run-tests.php
index 25e4807..9a5e276 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -576,8 +576,8 @@ if (isset($argc) && $argc > 1) {
if (!$valgrind_header) {
error("Valgrind returned no version info, cannot proceed.\nPlease check if Valgrind is
installed.");
} else {
- $valgrind_version =
preg_replace("/valgrind-([0-9])\.([0-9])\.([0-9]+)([.-\w]+)?(\s+)/", '$1$2$3',
$valgrind_header, 1, $replace_count);
- if ($replace_count != 1 || !is_numeric($valgrind_version)) {
+ $valgrind_version = preg_replace("/valgrind-(\d+)\.(\d+)\.(\d+)([.\w_-]+)?(\s+)/",
'$1.$2.$3', $valgrind_header, 1, $replace_count);
+ if ($replace_count != 1) {
error("Valgrind returned invalid version info (\"$valgrind_header\"), cannot
proceed.");
}
$valgrind_header = trim($valgrind_header);
@@ -1777,7 +1777,7 @@ TEST $file
$env['USE_ZEND_ALLOC'] = '0';
$env['ZEND_DONT_UNLOAD_MODULES'] = 1;
- if ($valgrind_version >= 330) {
+ if (version_compare($valgrind_version, '3.3.0', '>=')) {
/* valgrind 3.3.0+ doesn't have --log-file-exactly option */
$cmd = "valgrind -q --tool=memcheck --trace-children=yes --log-file=$memcheck_filename
$cmd";
} else {