0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-10 20:38:42 +00:00

(Commandfile) add code coverage reporting

This commit is contained in:
Stefan Siegl 2017-03-12 18:13:35 +01:00
parent 5073111829
commit 5ca50f5253
3 changed files with 22 additions and 2 deletions

2
.gitignore vendored
View File

@ -40,3 +40,5 @@ tests/*.mem
.vagrant .vagrant
tmp-php.ini tmp-php.ini
coverage_report/**

View File

@ -20,7 +20,7 @@ command 'configure',
command 'clean', command 'clean',
description: 'executes "make clean"', description: 'executes "make clean"',
script: <<-eof script: <<-eof
cd /data/build; `which gmake || which make` clean cd /data/build; `which gmake || which make` clean; rm -rf /data/v8js/coverage_report /data/build/gcov.info
eof eof
command 'build', command 'build',
@ -49,3 +49,21 @@ chain 'all',
{ command: 'build' }, { command: 'build' },
{ command: 'test' } { command: 'test' }
] ]
command 'coverage_report',
description: 'capture *.gcda files and generate code coverage report',
script: <<-eof
cd /data/build
lcov --base-directory=.libs --directory=.libs --directory ../v8js/ --no-external --capture --output-file gcov.info
genhtml --legend --output-directory ../v8js/coverage_report/ --title "V8Js Code Coverage" gcov.info
eof
chain 'coverage',
commands: [
{ command: 'phpize' },
{ command: 'configure', argv: ['--cxxflags=-O0 --coverage', '--ldflags=--coverage'] },
{ command: 'clean' },
{ command: 'build' },
{ command: 'test' },
{ command: 'coverage_report' },
]

2
Vagrantfile vendored
View File

@ -27,7 +27,7 @@ Vagrant.configure("2") do |config|
gpg --armor --export 7F438280EF8D349F | apt-key add - gpg --armor --export 7F438280EF8D349F | apt-key add -
apt-get update apt-get update
apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
add-apt-repository ppa:ondrej/php add-apt-repository ppa:ondrej/php
add-apt-repository ppa:pinepain/libv8-#{version} add-apt-repository ppa:pinepain/libv8-#{version}