Skip to content

Commit 242b554

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 17f9136 + db54b0f commit 242b554

File tree

6 files changed

+103
-27
lines changed

6 files changed

+103
-27
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ tmp-php.ini
258258
# ------------------------------------------------------------------------------
259259
*.gcda
260260
*.gcno
261+
/gcovr.xml
262+
/gcovr_html/
261263
/lcov_html/
262264
/php_lcov.info
263265

azure-pipelines.yml

+4
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,7 @@ jobs:
8282
--enable-debug --enable-zts
8383
CFLAGS='-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC'
8484
LDFLAGS='-fsanitize=undefined,address'
85+
- template: azure/coverage_job.yml
86+
parameters:
87+
configurationName: COVERAGE_DEBUG_ZTS
88+
configurationParameters: '--enable-debug --disable-zts'

azure/coverage_job.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
parameters:
2+
configurationName: ''
3+
configurationParameters: ''
4+
runTestsParameters: ''
5+
timeoutInMinutes: 60
6+
7+
jobs:
8+
- job: ${{ parameters.configurationName }}
9+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
10+
pool:
11+
vmImage: 'ubuntu-latest'
12+
steps:
13+
- template: apt.yml
14+
- script: |
15+
sudo -H pip install gcovr
16+
displayName: 'Install gcovr'
17+
- template: configure.yml
18+
parameters:
19+
configurationParameters: --enable-gcov ${{ parameters.configurationParameters }}
20+
- script: make -j$(/usr/bin/nproc) >/dev/null
21+
displayName: 'Make Build'
22+
- template: install.yml
23+
- script: |
24+
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
25+
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
26+
sudo -u postgres psql -c "CREATE DATABASE test;"
27+
displayName: 'Setup'
28+
- template: test.yml
29+
parameters:
30+
configurationName: ${{ parameters.configurationName }}
31+
runTestsParameters: ${{ parameters.runTestsParameters }}
32+
- script: |
33+
make gcovr-xml
34+
mv gcovr.xml coverage.xml
35+
displayName: 'Generate ${{ parameters.configurationName }} Test Coverage'
36+
condition: or(succeeded(), failed())
37+
- task: PublishCodeCoverageResults@1
38+
inputs:
39+
codeCoverageTool: 'Cobertura'
40+
summaryFileLocation: coverage.xml
41+
displayName: 'Publish ${{ parameters.configurationName }} Test Coverage'
42+
condition: or(succeeded(), failed())

azure/install.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
- script: |
3+
sudo make install
4+
sudo mkdir /etc/php.d
5+
sudo chmod 777 /etc/php.d
6+
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
7+
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
8+
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
9+
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
10+
displayName: 'Install Build'

azure/job.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ jobs:
1616
configurationParameters: ${{ parameters.configurationParameters }}
1717
- script: make -j$(/usr/bin/nproc) >/dev/null
1818
displayName: 'Make Build'
19-
- script: |
20-
sudo make install
21-
sudo mkdir /etc/php.d
22-
sudo chmod 777 /etc/php.d
23-
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
24-
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
25-
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
26-
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
27-
displayName: 'Install Build'
19+
- template: install.yml
2820
- script: |
2921
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
3022
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"

build/Makefile.gcov

+44-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,64 @@
11
#
2-
# LCOV
2+
# GCOV
33
#
44

55
LTP = lcov
66
LTP_GENHTML = genhtml
77

8-
lcov: lcov-html
8+
LCOV_EXCLUDES = \
9+
'$(top_srcdir)/ext/bcmath/libbcmath/*' \
10+
'$(top_srcdir)/ext/date/lib/*' \
11+
'$(top_srcdir)/ext/fileinfo/libmagic/*' \
12+
'$(top_srcdir)/ext/gd/libgd/*' \
13+
'$(top_srcdir)/ext/hash/sha3/*' \
14+
'$(top_srcdir)/ext/mbstring/libmbfl/*' \
15+
'$(top_srcdir)/ext/opcache/jit/libudis86/*' \
16+
'$(top_srcdir)/ext/pcre/pcre2lib/*' \
17+
'$(top_srcdir)/ext/xmlrpc/libxmlrpc/*'
18+
19+
GCOVR_EXCLUDES = \
20+
'ext/bcmath/libbcmath/.*' \
21+
'ext/date/lib/.*' \
22+
'ext/fileinfo/libmagic/.*' \
23+
'ext/gd/libgd/.*' \
24+
'ext/hash/sha3/.*' \
25+
'ext/mbstring/libmbfl/.*' \
26+
'ext/opcache/jit/libudis86/.*' \
27+
'ext/pcre/pcre2lib/.*' \
28+
'ext/xmlrpc/libxmlrpc/.*'
929

10-
lcov-test: lcov-clean-data test
30+
lcov: lcov-html
1131

12-
php_lcov.info: lcov-test
32+
php_lcov.info:
1333
@echo "Generating lcov data for $@"
14-
@$(LTP) --capture --no-external --directory . --output-file $@
34+
$(LTP) --capture --no-external --directory . --output-file $@
1535
@echo "Stripping bundled libraries from $@"
16-
@$(LTP) --remove $@ \
17-
'*/<stdout>' \
18-
'$(top_srcdir)/ext/bcmath/libbcmath/*' \
19-
'$(top_srcdir)/ext/date/lib/*' \
20-
'$(top_srcdir)/ext/fileinfo/libmagic/*' \
21-
'$(top_srcdir)/ext/gd/libgd/*' \
22-
'$(top_srcdir)/ext/hash/sha3/*' \
23-
'$(top_srcdir)/ext/mbstring/libmbfl/*' \
24-
'$(top_srcdir)/ext/opcache/jit/libudis86/*' \
25-
'$(top_srcdir)/ext/pcre/pcre2lib/*' \
26-
'$(top_srcdir)/ext/xmlrpc/libxmlrpc/*' \
27-
--output-file $@
36+
$(LTP) --output-file $@ --remove $@ '*/<stdout>' $(LCOV_EXCLUDES)
2837

2938
lcov-html: php_lcov.info
3039
@echo "Generating lcov HTML"
31-
@$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
40+
$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
3241

3342
lcov-clean:
3443
rm -f php_lcov.info
3544
rm -rf lcov_html/
3645

3746
lcov-clean-data:
3847
@find . -name \*.gcda -o -name \*.da -o -name \*.bbg? | xargs rm -f
48+
49+
gcovr-html:
50+
@echo "Generating gcovr HTML"
51+
@rm -rf gcovr_html/
52+
@mkdir gcovr_html
53+
gcovr -sr . -o gcovr_html/index.html --html --html-details \
54+
--exclude-directories 'ext/date/lib$$' \
55+
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
56+
57+
gcovr-xml:
58+
@echo "Generating gcovr XML"
59+
@rm -f gcovr.xml
60+
gcovr -sr . -o gcovr.xml --xml \
61+
--exclude-directories 'ext/date/lib$$' \
62+
$(foreach lib, $(GCOVR_EXCLUDES), -e $(lib))
63+
64+
.PHONY: gcovr-html lcov-html php_lcov.info

0 commit comments

Comments
 (0)