-
Notifications
You must be signed in to change notification settings - Fork 7.9k
run-tests: removed unused code #16675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
run-tests.php
Outdated
@@ -3651,11 +3650,6 @@ class RuntestsValgrind | |||
protected bool $version_3_8_0; | |||
protected string $tool; | |||
|
|||
public function getHeader(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never invoked method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sure?
Line 907 in 9d948c1
VALGRIND : " . ($valgrind ? $valgrind->getHeader() : 'Not used') . " |
run-tests.php
Outdated
@@ -3672,20 +3666,6 @@ public function __construct(array $environment, string $tool = 'memcheck') | |||
$this->header = sprintf("%s (%s)", trim($header), $this->tool); | |||
$this->version_3_8_0 = version_compare($version, '3.8.0', '>='); | |||
} | |||
|
|||
public function wrapCommand(string $cmd, string $memcheck_filename, bool $check_all): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never invoked method.
in the past this was used in
Lines 2432 to 2437 in 196f8fd
if ($valgrind) { | |
$env['USE_ZEND_ALLOC'] = '0'; | |
$env['ZEND_DONT_UNLOAD_MODULES'] = 1; | |
$cmd = $valgrind->wrapCommand($cmd, $memcheck_filename, strpos($test_file, "pcre") !== false); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think this if
code can no longer be executed? Or how did you conclude this is never invoked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
phpstorm indicated the unused code. it seems it got tricked by the untyped global
variables (and I got tricked by phpstorm ;)).
would you accept a new PR which gets rid of global variables in run-tests where possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that's not worth it, it will make merging fixes in the test runner from lower to higher branches a bit harder, for no obvious benefit imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. proposed something in #16678 - feel free to close it if you don't think its valuable
/** | ||
* @return bool|int | ||
*/ | ||
function comp_line(string $l1, string $l2, bool $is_reg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never called function
run-tests.php
Outdated
@@ -3651,11 +3650,6 @@ class RuntestsValgrind | |||
protected bool $version_3_8_0; | |||
protected string $tool; | |||
|
|||
public function getHeader(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sure?
Line 907 in 9d948c1
VALGRIND : " . ($valgrind ? $valgrind->getHeader() : 'Not used') . " |
run-tests.php
Outdated
@@ -3672,20 +3666,6 @@ public function __construct(array $environment, string $tool = 'memcheck') | |||
$this->header = sprintf("%s (%s)", trim($header), $this->tool); | |||
$this->version_3_8_0 = version_compare($version, '3.8.0', '>='); | |||
} | |||
|
|||
public function wrapCommand(string $cmd, string $memcheck_filename, bool $check_all): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think this if
code can no longer be executed? Or how did you conclude this is never invoked?
97c05d7
to
1c43015
Compare
No description provided.