File tree Expand file tree Collapse file tree 6 files changed +41
-7
lines changed
generate/templates/templates Expand file tree Collapse file tree 6 files changed +41
-7
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,16 @@ before_install:
1616 - if [ $TRAVIS_OS_NAME == "linux" ]; then
1717 sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
1818 sudo apt-get -qq update;
19- sudo apt-get -qq install g++-4.8 lcov;
20- export CXX='g++-4.8';
21- export GYP_DEFINES='coverage=1';
19+ sudo apt-get -qq install gcc-4.8 g++-4.8 lcov;
20+ sudo rm /usr/bin/gcov /usr/bin/g++;
21+ sudo ln -s /usr/bin/gcov-4.8 /usr/bin/gcov;
22+ sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++;
23+ export CC="gcc-4.8";
24+ export CXX="g++-4.8";
25+ export GYP_DEFINES="coverage=1";
26+ export JOBS=4;
27+ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90;
2228 fi
23- - " export JOBS=4"
2429 - BUILD_ONLY=true npm install
2530# This is a random private key used purely for testing.
2631before_script :
@@ -41,7 +46,12 @@ branches:
4146os :
4247 - linux
4348 - osx
44- script : npm test
49+ script :
50+ - if [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then
51+ npm test && npm run cov && npm run coveralls;
52+ else
53+ npm test;
54+ fi
4555notifications :
4656 slack :
4757 secure : KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc=
Original file line number Diff line number Diff line change 99 <th>Linux</th>
1010 <th>OS X</th>
1111 <th>Windows</th>
12+ <th>Coverage</th>
1213 <th>Dependencies</th>
1314 </tr>
1415 </thead >
@@ -20,6 +21,9 @@ NodeGit
2021 <td align="center">
2122 <a href="https://ci.appveyor.com/project/timbranyen/nodegit"><img src="https://ci.appveyor.com/api/projects/status/e5a5q75l9yfhnfv2?svg=true"></a>
2223 </td>
24+ <td align="center">
25+ <a href="https://coveralls.io/r/nodegit/nodegit"><img src="https://coveralls.io/repos/nodegit/nodegit/badge.svg" alt="Coverage Status"></a>
26+ </td>
2327 <td align="center">
2428 <a href="https://david-dm.org/nodegit/nodegit"><img src="https://david-dm.org/nodegit/nodegit.svg"></a>
2529 </td>
Original file line number Diff line number Diff line change 99 "<(module_root_dir)/vendor/libgit2.gyp:libgit2"
1010 ],
1111
12+ "variables" : {
13+ "coverage%" : 0
14+ },
15+
1216 "sources" : [
1317 "src/nodegit.cc" ,
1418 "src/wrapper.cc" ,
3236 ],
3337
3438 "conditions" : [
39+ [
40+ "coverage==1" , {
41+ "cflags" : [
42+ "-ftest-coverage" ,
43+ "-fprofile-arcs"
44+ ],
45+ "link_settings" : {
46+ "libraries" : [
47+ "-lgcov"
48+ ]
49+ },
50+ }
51+ ],
3552 [
3653 "OS=='mac'" , {
3754 "xcode_settings" : {
Original file line number Diff line number Diff line change @@ -86,7 +86,8 @@ function build() {
8686
8787 var opts = {
8888 cwd : "." ,
89- maxBuffer : Number . MAX_VALUE
89+ maxBuffer : Number . MAX_VALUE ,
90+ env : process . env
9091 } ;
9192
9293 var prefix = "" ;
Original file line number Diff line number Diff line change 6363 },
6464 "devDependencies" : {
6565 "combyne" : " ^0.6.5" ,
66+ "coveralls" : " ^2.11.2" ,
6667 "istanbul" : " ^0.3.5" ,
6768 "js-beautify" : " ^1.5.4" ,
6869 "jshint" : " ^2.6.0" ,
8283 },
8384 "scripts" : {
8485 "lint" : " jshint lib test/tests examples lifecycleScripts" ,
86+ "coveralls" : " cat ./test/coverage/merged.lcov | coveralls" ,
8587 "cppcov" : " mkdir -p test/coverage/cpp && lcov --capture --directory build/Release/obj.target/nodegit/src --output-file test/coverage/cpp/lcov.info" ,
8688 "mergecov" : " lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && genhtml test/coverage/merged.lcov --output-directory test/coverage/report" ,
8789 "cov" : " npm run cppcov && npm run mergecov" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ var fork = require("child_process").fork;
22var path = require ( "path" ) ;
33
44var bin = "./node_modules/.bin/istanbul" ;
5- var cov = "cover --report=lcov _mocha --" . split ( " " ) ;
5+ var cov = "cover --report=lcov --dir=test/coverage/js _mocha --" . split ( " " ) ;
66
77if ( process . platform === 'win32' ) {
88 bin = "./node_modules/mocha/bin/mocha" ;
You can’t perform that action at this time.
0 commit comments