diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2019-03-23 16:47:10 -0400 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-03-25 13:58:22 +0100 |
commit | 936356bf1e080ee9a9c05d2808d903a1f8a8004c (patch) | |
tree | ae2f725052ae3e69b1fe88abf30dcbe57f9ff6f7 | |
parent | 8b94042c470ceb83432a169f7df042f508c1c400 (diff) | |
download | php-git-936356bf1e080ee9a9c05d2808d903a1f8a8004c.tar.gz |
Make run-tests.php compatible with php 7.0-7.2
Motivation:
As an extension author, I want to speed up running tests in php <=7.3,
both locally and in CI (e.g. with valgrind).
This can be done by manually copying php 7.4's run-tests.php script
to replace the one generated by `phpize`
- list() doesn't work in php 7.0
- negative string offset doesn't work in php 7.2
If run-tests.php can be copied from php-src without any manual patches,
that would be the easiest.
Related to #2822 - I didn't see any discussion for/against compatibility
with older php versions
-rwxr-xr-x | run-tests.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/run-tests.php b/run-tests.php index 9b6e85ab40..63ee77cd03 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1505,7 +1505,7 @@ escape: $rawMessage = $rawMessageBuffers[$i] . $rawMessage; $rawMessageBuffers[$i] = ''; } - if ($rawMessage[-1] !== "\n") { + if (substr($rawMessage, -1) !== "\n") { $rawMessageBuffers[$i] = $rawMessage; continue; } @@ -1571,7 +1571,7 @@ escape: } break; case "test_result": - [$name, $index, $result, $resultText] = [$message["name"], $message["index"], $message["result"], $message["text"]]; + list($name, $index, $result, $resultText) = [$message["name"], $message["index"], $message["result"], $message["text"]]; foreach ($message["PHP_FAILED_TESTS"] as $category => $tests) { $PHP_FAILED_TESTS[$category] = array_merge($PHP_FAILED_TESTS[$category], $tests); } |