Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@ before_install:
- nvm use $NODE_VERSION
- if [ $TRAVIS_OS_NAME == "linux" ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
sudo apt-get -qq update;
sudo apt-get -qq install g++-4.8;
export CXX='g++-4.8';
sudo apt-get update;
sudo apt-get install gcc-4.9 g++-4.9 lcov;
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20;
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20;
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 20;
sudo update-alternatives --config gcc;
sudo update-alternatives --config g++;
sudo update-alternatives --config gcov;
wget http://downloads.sourceforge.net/ltp/lcov-1.10.tar.gz;
tar xvfz lcov-1.10.tar.gz;
sudo cp -v lcov-1.10/bin/{lcov,genpng,gendesc,genhtml,geninfo} /usr/bin/;
sudo chmod 777 /usr/bin/lcov /usr/bin/genhtml /usr/bin/geninfo /usr/bin/genpng /usg/bin/gendesc;
rm -rf lcov-1.10.tar.gz lcov-1.10;
sudo mv -v `which gcov-4.8` `which gcov`;
export GYP_DEFINES="coverage=1";
export JOBS=4;
fi
- "export JOBS=4"
- BUILD_ONLY=true npm install
# This is a random private key used purely for testing.
before_script:
Expand All @@ -40,7 +52,12 @@ branches:
os:
- linux
- osx
script: npm test
script:
- if [ $TRAVIS_OS_NAME == "linux" ] && [ $NODE_VERSION == "0.12" ]; then
npm test && npm run cov && npm run coveralls;
else
npm test;
fi
notifications:
slack:
secure: KglNSqZiid9YudCwkPFDh+sZfW5BwFlM70y67E4peHwwlbbV1sSBPHcs74ZHP/lqgEZ4hMv4N2NI58oYFD5/1a+tKIQP1TkdIMuq4j2LXheuirA2HDcydOVrsC8kRx5XFGKdVRg/uyX2dlRHcOWFhxrS6yc6IxtxYWlRTD2SmEc=
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ NodeGit
<th>Linux</th>
<th>OS X</th>
<th>Windows</th>
<th>Coverage</th>
<th>Dependencies</th>
</tr>
</thead>
Expand All @@ -20,15 +21,16 @@ NodeGit
<td align="center">
<a href="https://ci.appveyor.com/project/timbranyen/nodegit"><img src="https://ci.appveyor.com/api/projects/status/e5a5q75l9yfhnfv2?svg=true"></a>
</td>
<td align="center">
<a href="https://coveralls.io/r/nodegit/nodegit"><img src="https://coveralls.io/repos/nodegit/nodegit/badge.svg" alt="Coverage Status"></a>
</td>
<td align="center">
<a href="https://david-dm.org/nodegit/nodegit"><img src="https://david-dm.org/nodegit/nodegit.svg"></a>
</td>
</tr>
</tbody>
</table>

***NOTE: NodeGit currently does not work with [iojs on windows](https://github.com/rvagg/pangyp/issues/4)***

**Stable: 0.3.3**

## Have a problem? Come chat with us! ##
Expand Down Expand Up @@ -59,6 +61,8 @@ dependencies.
npm install nodegit
```

**Note: NodeGit will only work on io.js Windows with [the iojs binary instead of node](https://github.com/rvagg/pangyp/issues/4).**

If you encounter problems while installing, you should try the Building from
source instructions below.

Expand Down
17 changes: 17 additions & 0 deletions generate/templates/templates/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"<(module_root_dir)/vendor/libgit2.gyp:libgit2"
],

"variables": {
"coverage%": 0
},

"sources": [
"src/nodegit.cc",
"src/wrapper.cc",
Expand All @@ -32,6 +36,19 @@
],

"conditions": [
[
"coverage==1", {
"cflags": [
"-ftest-coverage",
"-fprofile-arcs"
],
"link_settings": {
"libraries": [
"-lgcov"
]
},
}
],
[
"OS=='mac'", {
"xcode_settings": {
Expand Down
3 changes: 2 additions & 1 deletion lifecycleScripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ function build() {

var opts = {
cwd: ".",
maxBuffer: Number.MAX_VALUE
maxBuffer: Number.MAX_VALUE,
env: process.env
};

var prefix = "";
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@
},
"devDependencies": {
"combyne": "^0.6.5",
"coveralls": "^2.11.2",
"istanbul": "^0.3.5",
"js-beautify": "^1.5.4",
"jshint": "^2.6.0",
"lcov-result-merger": "^1.0.2",
"lodash": "^3.1.0",
"mocha": "~2.1.0",
"nan": "^1.7.0",
Expand All @@ -81,10 +83,13 @@
},
"scripts": {
"lint": "jshint lib test/tests examples lifecycleScripts",
"cov": "node --expose-gc test",
"coveralls": "cat ./test/coverage/merged.lcov | coveralls",
"cppcov": "mkdir -p test/coverage/cpp && lcov --gcov-tool $(which gcov) --capture --directory build/Release/obj.target/nodegit/src --output-file test/coverage/cpp/lcov.info",
"mergecov": "lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && genhtml test/coverage/merged.lcov --output-directory test/coverage/report",
"cov": "npm run cppcov && npm run mergecov",
"mocha": "mocha test/runner test/tests",
"mochaDebug": "mocha --debug-brk test/runner test/tests",
"test": "npm run lint && npm run cov",
"test": "npm run lint && iojs --expose-gc test || node --expose-gc test",
"generateJson": "node generate/scripts/generateJson",
"generateNativeCode": "node generate/scripts/generateNativeCode",
"generateMissingTests": "node generate/scripts/generateMissingTests",
Expand Down
28 changes: 13 additions & 15 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
var fork = require("child_process").fork;
var path = require("path");

var args = [
"cover",
process.platform != "win32" ?
"_mocha" :
"../node_modules/mocha/bin/_mocha",
"--",
"runner",
"tests",
"--report=lcov",
var bin = "./node_modules/.bin/istanbul";
var cov = "cover --report=lcov --dir=test/coverage/js _mocha --".split(" ");

if (process.platform === 'win32') {
bin = "./node_modules/mocha/bin/mocha";
cov = [];
}

var args = cov.concat([
"test/runner",
"test/tests",
"--expose-gc"
];
]);

fork("../node_modules/istanbul/lib/cli.js", args, {
cwd: __dirname
}).on("close", function(code) {
process.exit(code);
});
fork(bin, args, { cwd: path.join(__dirname, "../") }).on("close", process.exit);