Skip to content

Commit 5ca50f5

Browse files
committed
(Commandfile) add code coverage reporting
1 parent 5073111 commit 5ca50f5

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ tests/*.mem
4040

4141
.vagrant
4242
tmp-php.ini
43+
44+
coverage_report/**

Commandfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ command 'configure',
2020
command 'clean',
2121
description: 'executes "make clean"',
2222
script: <<-eof
23-
cd /data/build; `which gmake || which make` clean
23+
cd /data/build; `which gmake || which make` clean; rm -rf /data/v8js/coverage_report /data/build/gcov.info
2424
eof
2525

2626
command 'build',
@@ -49,3 +49,21 @@ chain 'all',
4949
{ command: 'build' },
5050
{ command: 'test' }
5151
]
52+
53+
command 'coverage_report',
54+
description: 'capture *.gcda files and generate code coverage report',
55+
script: <<-eof
56+
cd /data/build
57+
lcov --base-directory=.libs --directory=.libs --directory ../v8js/ --no-external --capture --output-file gcov.info
58+
genhtml --legend --output-directory ../v8js/coverage_report/ --title "V8Js Code Coverage" gcov.info
59+
eof
60+
61+
chain 'coverage',
62+
commands: [
63+
{ command: 'phpize' },
64+
{ command: 'configure', argv: ['--cxxflags=-O0 --coverage', '--ldflags=--coverage'] },
65+
{ command: 'clean' },
66+
{ command: 'build' },
67+
{ command: 'test' },
68+
{ command: 'coverage_report' },
69+
]

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Vagrant.configure("2") do |config|
2727
gpg --armor --export 7F438280EF8D349F | apt-key add -
2828
2929
apt-get update
30-
apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils
30+
apt-get install -y software-properties-common gdb tmux git tig curl apache2-utils lcov
3131
3232
add-apt-repository ppa:ondrej/php
3333
add-apt-repository ppa:pinepain/libv8-#{version}

0 commit comments

Comments
 (0)