File tree Expand file tree Collapse file tree 5 files changed +81
-2
lines changed Expand file tree Collapse file tree 5 files changed +81
-2
lines changed Original file line number Diff line number Diff line change 17
17
matrix :
18
18
- DRIVER="xdebug" DEPENDENCIES="high"
19
19
- DRIVER="phpdbg" DEPENDENCIES="high"
20
+ - DRIVER="pcov" DEPENDENCIES="high"
20
21
- DRIVER="xdebug" DEPENDENCIES="low"
21
22
- DRIVER="phpdbg" DEPENDENCIES="low"
23
+ - DRIVER="pcov" DEPENDENCIES="low"
22
24
global :
23
25
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"
24
26
25
27
before_install :
26
28
- composer self-update
27
29
- composer clear-cache
30
+ - export COMPOSER_ROOT_VERSION=6.1.99
28
31
29
32
install :
30
33
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi
31
34
- if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi
32
35
36
+ before_script :
37
+ - |
38
+ if [[ "$DRIVER" = 'pcov' ]]; then
39
+ echo > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/xdebug.ini
40
+ git clone https://github.com/krakjoe/pcov
41
+ cd pcov
42
+ phpize
43
+ ./configure
44
+ make clean install
45
+ echo "extension=pcov.so" > $HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/pcov.ini
46
+ cd $TRAVIS_BUILD_DIR
47
+ fi
48
+
33
49
script :
34
50
- if [[ "$DRIVER" = 'phpdbg' ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
35
51
- if [[ "$DRIVER" = 'xdebug' ]]; then vendor/bin/phpunit --coverage-clover=coverage.xml; fi
52
+ - if [[ "$DRIVER" = 'pcov' ]]; then vendor/bin/phpunit --coverage-clover=coverage.xml; fi
36
53
37
54
after_success :
38
55
- bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change 32
32
"phpunit/php-token-stream" : " ^3.0.1" ,
33
33
"phpunit/php-text-template" : " ^1.2.1" ,
34
34
"sebastian/code-unit-reverse-lookup" : " ^1.0.1" ,
35
- "sebastian/environment" : " ^4.0 " ,
35
+ "sebastian/environment" : " ^4.1 " ,
36
36
"sebastian/version" : " ^2.0.1" ,
37
37
"theseer/tokenizer" : " ^1.1"
38
38
},
57
57
"branch-alias" : {
58
58
"dev-master" : " 6.1-dev"
59
59
}
60
- }
60
+ },
61
+ "minimum-stability" : " dev"
61
62
}
Original file line number Diff line number Diff line change 14
14
use PHPUnit \Util \Test ;
15
15
use SebastianBergmann \CodeCoverage \Driver \Driver ;
16
16
use SebastianBergmann \CodeCoverage \Driver \PHPDBG ;
17
+ use SebastianBergmann \CodeCoverage \Driver \PCOV ;
17
18
use SebastianBergmann \CodeCoverage \Driver \Xdebug ;
18
19
use SebastianBergmann \CodeCoverage \Node \Builder ;
19
20
use SebastianBergmann \CodeCoverage \Node \Directory ;
@@ -905,6 +906,10 @@ private function selectDriver(Filter $filter): Driver
905
906
return new Xdebug ($ filter );
906
907
}
907
908
909
+ if ($ runtime ->hasPCOV ()) {
910
+ return new PCOV ($ filter );
911
+ }
912
+
908
913
throw new RuntimeException ('No code coverage driver available ' );
909
914
}
910
915
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /*
3
+ * This file is part of the php-code-coverage package.
4
+ *
5
+ * (c) Sebastian Bergmann <[email protected] >
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ namespace SebastianBergmann \CodeCoverage \Driver ;
11
+
12
+ use SebastianBergmann \CodeCoverage \RuntimeException ;
13
+ use SebastianBergmann \CodeCoverage \Filter ;
14
+
15
+ /**
16
+ * Driver for PCOV code coverage functionality.
17
+ *
18
+ * @codeCoverageIgnore
19
+ */
20
+ final class PCOV implements Driver
21
+ {
22
+ public function __construct (Filter $ filter = null )
23
+ {
24
+
25
+ }
26
+
27
+ /**
28
+ * Start collection of code coverage information.
29
+ */
30
+ public function start (bool $ determineUnusedAndDead = true ): void
31
+ {
32
+ \pcov \start ();
33
+ }
34
+
35
+ /**
36
+ * Stop collection of code coverage information.
37
+ */
38
+ public function stop (): array
39
+ {
40
+ \pcov \stop ();
41
+
42
+ $ waiting = \pcov \waiting ();
43
+ $ collect = [];
44
+
45
+ if ($ waiting ) {
46
+ $ collect = \pcov \collect (\pcov \inclusive, $ waiting );
47
+
48
+ if ($ collect ) {
49
+ \pcov \clear ();
50
+ }
51
+ }
52
+
53
+ return $ collect ;
54
+ }
55
+ }
Original file line number Diff line number Diff line change 11
11
12
12
use SebastianBergmann \CodeCoverage \Driver \Driver ;
13
13
use SebastianBergmann \CodeCoverage \Driver \PHPDBG ;
14
+ use SebastianBergmann \CodeCoverage \Driver \PCOV ;
14
15
use SebastianBergmann \CodeCoverage \Driver \Xdebug ;
15
16
use SebastianBergmann \Environment \Runtime ;
16
17
You can’t perform that action at this time.
0 commit comments