-
-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
328 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--TEST-- | ||
Test for bug #213: Dead code analysis doesn't take catches for throws into account (>= PHP 7.3, opcache) | ||
--SKIPIF-- | ||
<?php | ||
if (version_compare(phpversion(), "7.3", '<')) echo "skip >= PHP 7.3 needed\n"; | ||
if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; | ||
?> | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.auto_trace=0 | ||
xdebug.trace_options=0 | ||
xdebug.trace_output_dir=/tmp | ||
xdebug.collect_params=1 | ||
xdebug.collect_return=0 | ||
xdebug.auto_profile=0 | ||
xdebug.profiler_enable=0 | ||
xdebug.dump_globals=0 | ||
xdebug.show_mem_delta=0 | ||
xdebug.trace_format=0 | ||
xdebug.extended_info=1 | ||
xdebug.coverage_enable=1 | ||
xdebug.overload_var_dump=0 | ||
--FILE-- | ||
<?php | ||
xdebug_start_code_coverage( XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE ); | ||
$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug00213.inc'; | ||
include $file; | ||
$cc = xdebug_get_code_coverage(); | ||
xdebug_stop_code_coverage(); | ||
var_dump($cc[$file]); | ||
?> | ||
--EXPECT-- | ||
48 | ||
array(5) { | ||
[5]=> | ||
int(1) | ||
[6]=> | ||
int(-2) | ||
[8]=> | ||
int(1) | ||
[12]=> | ||
int(1) | ||
[14]=> | ||
int(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--TEST-- | ||
Test for bug #334: Code Coverage Regressions (>= PHP 7.3, opcache) | ||
--SKIPIF-- | ||
<?php | ||
if (version_compare(phpversion(), "7.3", '<')) echo "skip >= PHP 7.3 needed\n"; | ||
if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; | ||
?> | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.dump_globals=0 | ||
xdebug.show_mem_delta=0 | ||
xdebug.profiler_enable=0 | ||
xdebug.trace_format=0 | ||
xdebug.overload_var_dump=0 | ||
--FILE-- | ||
<?php | ||
// Run me from the PHP CLI | ||
xdebug_start_code_coverage(XDEBUG_CC_DEAD_CODE | XDEBUG_CC_UNUSED); | ||
// MUST be both code coverage options to cause problems | ||
include(dirname(__FILE__).'/bug00334.inc'); // File with problem in it. | ||
$c = xdebug_get_code_coverage(); | ||
ksort($c); | ||
var_dump($c); | ||
xdebug_stop_code_coverage(); | ||
?> | ||
--EXPECTF-- | ||
array(2) { | ||
["%sbug00334-php73-opcache.php"]=> | ||
array(2) { | ||
[5]=> | ||
int(1) | ||
[6]=> | ||
int(1) | ||
} | ||
["%sbug00334.inc"]=> | ||
array(3) { | ||
[5]=> | ||
int(1) | ||
[7]=> | ||
int(-1) | ||
[9]=> | ||
int(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--TEST-- | ||
Test for bug #1270: String parsing marked not covered (>= PHP 7.3, opcache) | ||
--SKIPIF-- | ||
<?php | ||
if (version_compare(phpversion(), "7.3", '<')) echo "skip >= PHP 7.3 needed\n"; | ||
if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; | ||
?> | ||
--FILE-- | ||
<?php | ||
xdebug_start_code_coverage( XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE ); | ||
|
||
include dirname( __FILE__ ) . '/bug01270.inc'; | ||
|
||
try { func1(); } catch (Exception $e) { } | ||
try { func2(); } catch (Exception $e) { } | ||
try { func3(); } catch (Exception $e) { } | ||
|
||
$cc = xdebug_get_code_coverage(); | ||
|
||
ksort( $cc ); | ||
var_dump( array_slice( $cc, 1, 1 ) ); | ||
?> | ||
--EXPECTF-- | ||
array(1) { | ||
["%sbug01270.inc"]=> | ||
array(20) { | ||
[2]=> | ||
int(1) | ||
[4]=> | ||
int(1) | ||
[5]=> | ||
int(1) | ||
[6]=> | ||
int(-1) | ||
[7]=> | ||
int(1) | ||
[9]=> | ||
int(-2) | ||
[11]=> | ||
int(1) | ||
[13]=> | ||
int(1) | ||
[14]=> | ||
int(1) | ||
[15]=> | ||
int(-1) | ||
[16]=> | ||
int(1) | ||
[18]=> | ||
int(-2) | ||
[20]=> | ||
int(1) | ||
[22]=> | ||
int(1) | ||
[23]=> | ||
int(1) | ||
[25]=> | ||
int(-1) | ||
[27]=> | ||
int(1) | ||
[31]=> | ||
int(-2) | ||
[33]=> | ||
int(1) | ||
[35]=> | ||
int(-2) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--TEST-- | ||
Test for bug #1386: Executable code not shown as executed/executable (>= PHP 7.3, opcache) | ||
--SKIPIF-- | ||
<?php | ||
if (version_compare(phpversion(), "7.3", '<')) echo "skip >= PHP 7.3, < PHP 7.3 needed\n"; | ||
if (!extension_loaded('zend opcache')) echo "skip opcache required\n"; | ||
?> | ||
--INI-- | ||
xdebug.default_enable=1 | ||
xdebug.auto_trace=0 | ||
xdebug.trace_options=0 | ||
xdebug.trace_output_dir=/tmp | ||
xdebug.collect_params=1 | ||
xdebug.collect_return=0 | ||
xdebug.collect_assignments=0 | ||
xdebug.auto_profile=0 | ||
xdebug.profiler_enable=0 | ||
xdebug.dump_globals=0 | ||
xdebug.show_mem_delta=0 | ||
xdebug.trace_format=0 | ||
xdebug.extended_info=1 | ||
xdebug.coverage_enable=1 | ||
xdebug.overload_var_dump=0 | ||
--FILE-- | ||
<?php | ||
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); | ||
|
||
include 'bug01386-class2.inc'; | ||
include 'bug01386-class1.inc'; | ||
|
||
$Test1 = new TestClass(); | ||
|
||
$cc = xdebug_get_code_coverage(); | ||
ksort($cc); | ||
var_dump(array_slice($cc, 0, 2)); | ||
|
||
xdebug_stop_code_coverage(false); | ||
?> | ||
--EXPECTF-- | ||
array(2) { | ||
["%sbug01386-class1.inc"]=> | ||
array(6) { | ||
[3]=> | ||
int(1) | ||
[7]=> | ||
int(-1) | ||
[8]=> | ||
int(-1) | ||
[9]=> | ||
int(-1) | ||
[10]=> | ||
int(-2) | ||
[13]=> | ||
int(1) | ||
} | ||
["%sbug01386-class2.inc"]=> | ||
array(6) { | ||
[3]=> | ||
int(1) | ||
[7]=> | ||
int(-1) | ||
[8]=> | ||
int(-1) | ||
[9]=> | ||
int(-1) | ||
[10]=> | ||
int(-2) | ||
[13]=> | ||
int(1) | ||
} | ||
} | ||
|
Oops, something went wrong.