Skip to content
Permalink
Browse files

Branch coverage test changes due to PHP 7.4

  • Loading branch information...
derickr committed Jun 8, 2019
1 parent 9bb2e0a commit 41e09a80860364b6fd344a278047bc235b48923a
@@ -1,9 +1,9 @@
--TEST--
Test for bug #1034: path coverage [1] (>= PHP 7.3, opcache)
Test for bug #1034: path coverage [1] (>= PHP 7.3, < PHP 7.4, opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.3; opcache');
check_reqs('PHP >= 7.3,< 7.4; opcache');
?>
--FILE--
<?php
@@ -1,9 +1,9 @@
--TEST--
Test for bug #1034: path coverage [1] (>= PHP 7.3, !opcache)
Test for bug #1034: path coverage [1] (>= PHP 7.3, < PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.3; !opcache');
check_reqs('PHP >= 7.3,< 7.4; !opcache');
?>
--FILE--
<?php
@@ -0,0 +1,57 @@
--TEST--
Test for bug #1034: path coverage [1] (>= PHP 7.4, opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.4; opcache');
?>
--FILE--
<?php
include 'dump-branch-coverage.inc';
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);
include 'bug01034-001.inc';
xdebug_stop_code_coverage(false);
$c = xdebug_get_code_coverage();
dump_branch_coverage($c);
?>
--EXPECTF--
0 1 2 3
!42
caught
ifelse
- branches
- 00; OP: 00-04; line: 10-12 HIT; out1: 05 X ; out2: 08 HIT
- 05; OP: 05-07; line: 13-13 X ; out1: 12 X
- 08; OP: 08-11; line: 15-16 HIT; out1: EX X
- 12; OP: 12-15; line: 18-19 X ; out1: EX X
- paths
- 0 5 12: X
- 0 8: HIT

loopy
- branches
- 00; OP: 00-04; line: 02-04 HIT; out1: 10 HIT
- 05; OP: 05-09; line: 05-04 HIT; out1: 10 HIT
- 10; OP: 10-12; line: 04-04 HIT; out1: 13 HIT; out2: 05 HIT
- 13; OP: 13-16; line: 07-08 HIT; out1: EX X
- paths
- 0 10 13: HIT
- 0 10 5 10 13: HIT

trycatch
- branches
- 00; OP: 00-05; line: 21-24 HIT; out1: EX X
- 06; OP: 06-06; line: 26-26 HIT; out1: 07 HIT; out2: EX X
- 07; OP: 07-10; line: 27-29 HIT; out1: EX X
- paths
- 0: HIT
- 6 7: HIT

{main}
- branches
- 00; OP: 00-15; line: 31-36 HIT; out1: EX X
- paths
- 0: HIT
@@ -0,0 +1,57 @@
--TEST--
Test for bug #1034: path coverage [1] (>= PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.4; !opcache');
?>
--FILE--
<?php
include 'dump-branch-coverage.inc';
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);
include 'bug01034-001.inc';
xdebug_stop_code_coverage(false);
$c = xdebug_get_code_coverage();
dump_branch_coverage($c);
?>
--EXPECTF--
0 1 2 3
!42
caught
ifelse
- branches
- 00; OP: 00-04; line: 10-12 HIT; out1: 05 X ; out2: 08 HIT
- 05; OP: 05-07; line: 13-13 X ; out1: 12 X
- 08; OP: 08-11; line: 15-16 HIT; out1: EX X
- 12; OP: 12-15; line: 18-19 X ; out1: EX X
- paths
- 0 5 12: X
- 0 8: HIT

loopy
- branches
- 00; OP: 00-04; line: 02-04 HIT; out1: 11 HIT
- 05; OP: 05-10; line: 05-04 HIT; out1: 11 HIT
- 11; OP: 11-13; line: 04-04 HIT; out1: 14 HIT; out2: 05 HIT
- 14; OP: 14-17; line: 07-08 HIT; out1: EX X
- paths
- 0 11 14: HIT
- 0 11 5 11 14: HIT

trycatch
- branches
- 00; OP: 00-06; line: 21-24 HIT; out1: EX X
- 10; OP: 10-10; line: 26-26 HIT; out1: 11 HIT; out2: EX X
- 11; OP: 11-14; line: 27-29 HIT; out1: EX X
- paths
- 0: HIT
- 10 11: HIT

{main}
- branches
- 00; OP: 00-15; line: 31-36 HIT; out1: EX X
- paths
- 0: HIT
@@ -1,9 +1,9 @@
--TEST--
Test for bug #1034: path coverage [3] (>= PHP 7.3, !opcache)
Test for bug #1034: path coverage [3] (>= PHP 7.3, < PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.3; !opcache');
check_reqs('PHP >= 7.3,< 7.4; !opcache');
?>
--FILE--
<?php
@@ -0,0 +1,63 @@
--TEST--
Test for bug #1034: path coverage [3] (>= PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.4; !opcache');
?>
--FILE--
<?php
include 'dump-branch-coverage.inc';
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);
include 'bug01034-003.inc';
xdebug_stop_code_coverage(false);
$c = xdebug_get_code_coverage();
dump_branch_coverage($c);
?>
--EXPECTF--
Let's do some stuff!
caught
And do some more
Let's do some stuff!
caught
And do some more
Let's do some stuff!
CAUGHT IN MAIN
trycatch
- branches
- 00; OP: 00-14; line: 06-13 HIT; out1: 15 HIT; out2: 20 HIT
- 15; OP: 15-16; line: 14-14 HIT; out1: 17 HIT; out2: 25 HIT
- 17; OP: 17-18; line: 15-15 HIT; out1: 19 X ; out2: 30 HIT
- 19; OP: 19-19; line: 15-15 X ; out1: 35 X
- 20; OP: 20-24; line: 13-13 HIT; out1: EX X
- 25; OP: 25-29; line: 14-14 HIT; out1: EX X
- 30; OP: 30-34; line: 15-15 HIT; out1: EX X
- 35; OP: 35-37; line: 17-17 X ; out1: 49 X
- 38; OP: 38-38; line: 18-18 HIT; out1: 39 HIT; out2: 42 HIT
- 39; OP: 39-41; line: 19-19 HIT; out1: 49 HIT
- 42; OP: 42-42; line: 20-20 HIT; out1: 43 X ; out2: 46 HIT
- 43; OP: 43-45; line: 21-21 X ; out1: 49 X
- 46; OP: 46-46; line: 22-22 HIT; out1: 47 HIT; out2: EX X
- 47; OP: 47-48; line: 23-26 HIT; out1: 49 HIT
- 49; OP: 49-52; line: 26-27 HIT; out1: EX X
- paths
- 0 15 17 19 35 49: X
- 0 15 17 30: HIT
- 0 15 25: HIT
- 0 20: HIT
- 38 39 49: HIT
- 38 42 43 49: X
- 38 42 46 47 49: HIT

{main}
- branches
- 00; OP: 00-13; line: 29-32 HIT; out1: 17 X
- 14; OP: 14-14; line: 33-33 HIT; out1: 15 HIT; out2: EX X
- 15; OP: 15-16; line: 34-37 HIT; out1: 17 HIT
- 17; OP: 17-17; line: 37-37 HIT; out1: EX X
- paths
- 0 17: X
- 14 15 17: HIT
@@ -1,9 +1,9 @@
--TEST--
Test for bug #1034: path coverage [4] (> PHP 7.0.12, !opcache)
Test for bug #1034: path coverage [4] (> PHP 7.0.12, < PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP > 7.0.12; !opcache');
check_reqs('PHP > 7.0.12,< 7.4; !opcache');
?>
--FILE--
<?php
@@ -0,0 +1,50 @@
--TEST--
Test for bug #1034: path coverage [4] (>= PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.4; !opcache');
?>
--FILE--
<?php
include 'dump-branch-coverage.inc';
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);
include 'bug01034-004.inc';
xdebug_stop_code_coverage(false);
$c = xdebug_get_code_coverage();
dump_branch_coverage($c);
?>
--EXPECTF--
0
A HIT
B HIT
ifthenelse
- branches
- 00; OP: 00-04; line: 12-14 HIT; out1: 05 HIT; out2: 07 HIT
- 05; OP: 05-06; line: 15-17 HIT; out1: 07 HIT
- 07; OP: 07-08; line: 17-17 HIT; out1: 09 HIT; out2: 11 HIT
- 09; OP: 09-10; line: 18-20 HIT; out1: 11 HIT
- 11; OP: 11-12; line: 20-20 HIT; out1: EX X
- paths
- 0 5 7 9 11: X
- 0 5 7 11: HIT
- 0 7 9 11: HIT
- 0 7 11: X

loopy
- branches
- 00; OP: 00-02; line: 02-06 HIT; out1: 03 HIT
- 03; OP: 03-08; line: 06-08 HIT; out1: 09 HIT; out2: 03 X
- 09; OP: 09-12; line: 09-10 HIT; out1: EX X
- paths
- 0 3 9: HIT
- 0 3 3 9: X

{main}
- branches
- 00; OP: 00-14; line: 22-26 HIT; out1: EX X
- paths
- 0: HIT
@@ -1,9 +1,9 @@
--TEST--
Test for bug #1034: path coverage [5] (>= PHP 7.3, opcache)
Test for bug #1034: path coverage [5] (>= PHP 7.3, < PHP 7.4, opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.3; opcache');
check_reqs('PHP >= 7.3,< 7.4; opcache');
?>
--FILE--
<?php
@@ -1,9 +1,9 @@
--TEST--
Test for bug #1034: path coverage [5] (>= PHP 7.3, !opcache)
Test for bug #1034: path coverage [5] (>= PHP 7.3, < PHP 7.4, !opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.3; !opcache');
check_reqs('PHP >= 7.3,< 7.4; !opcache');
?>
--FILE--
<?php
@@ -0,0 +1,49 @@
--TEST--
Test for bug #1034: path coverage [5] (>= PHP 7.4, opcache)
--SKIPIF--
<?php
require __DIR__ . '/utils.inc';
check_reqs('PHP >= 7.4; opcache');
?>
--FILE--
<?php
include 'dump-branch-coverage.inc';
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE | XDEBUG_CC_BRANCH_CHECK);
try {
include 'bug01034-005.inc';
} catch (Exception $e) {
/* eat */
}
xdebug_stop_code_coverage(false);
$c = xdebug_get_code_coverage();
dump_branch_coverage($c);
?>
--EXPECTF--
caught
trycatch
- branches
- 00; OP: 00-05; line: 02-05 HIT; out1: EX X
- 06; OP: 06-06; line: 07-07 HIT; out1: 07 X ; out2: 10 HIT
- 07; OP: 07-09; line: 08-08 X ; out1: 21 X
- 10; OP: 10-10; line: 09-09 HIT; out1: 11 X ; out2: 14 HIT
- 11; OP: 11-13; line: 10-10 X ; out1: 21 X
- 14; OP: 14-14; line: 11-11 HIT; out1: 15 HIT; out2: 18 X
- 15; OP: 15-17; line: 12-12 HIT; out1: 21 HIT
- 18; OP: 18-18; line: 13-13 X ; out1: 19 X ; out2: EX X
- 19; OP: 19-20; line: 14-16 X ; out1: 21 X
- 21; OP: 21-22; line: 16-16 HIT; out1: EX X
- paths
- 0: HIT
- 6 7 21: X
- 6 10 11 21: X
- 6 10 14 15 21: HIT
- 6 10 14 18 19 21: X

{main}
- branches
- 00; OP: 00-03; line: 17-19 HIT; out1: EX X
- paths
- 0: HIT

0 comments on commit 41e09a8

Please sign in to comment.
You can’t perform that action at this time.